glm/test/bug/bug_ms_vec_static.cpp

49 lines
869 B
C++
Raw Normal View History

2017-01-07 11:49:45 +00:00
#include <glm/glm.hpp>
2018-07-31 21:05:48 +00:00
#if GLM_CONFIG_ANONYMOUS_STRUCT == GLM_ENABLE
2017-01-04 22:35:02 +00:00
struct vec2;
2017-01-04 22:19:48 +00:00
2017-01-04 22:35:02 +00:00
struct _swizzle
2017-01-04 22:19:48 +00:00
{
char _buffer[1];
};
struct vec2
{
2018-07-24 21:41:55 +00:00
GLM_CONSTEXPR vec2() :
2017-01-04 22:41:35 +00:00
x(0), y(0)
2017-01-04 22:19:48 +00:00
{}
#if defined(_MSC_VER)
# pragma warning(push)
# pragma warning(disable: 4201) // nonstandard extension used : nameless struct/union
#endif
#if GLM_COMPILER & GLM_COMPILER_CLANG
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wgnu-anonymous-struct"
# pragma clang diagnostic ignored "-Wnested-anon-types"
#endif
2017-01-04 22:19:48 +00:00
union
{
2017-01-04 22:35:02 +00:00
struct { float x, y; };
struct { _swizzle xx; };
2017-01-04 22:19:48 +00:00
};
#if GLM_COMPILER & GLM_COMPILER_CLANG
# pragma clang diagnostic pop
#endif
#if defined(_MSC_VER)
# pragma warning(pop)
#endif
2017-01-04 22:19:48 +00:00
};
2017-01-07 11:49:45 +00:00
#endif
2017-01-04 22:19:48 +00:00
// Visual C++ has a bug generating the error: fatal error C1001: An internal error has occurred in the compiler.
2017-01-07 11:15:08 +00:00
// vec2 Bar;
2016-09-25 08:29:08 +00:00
int main()
{
2016-09-25 08:35:30 +00:00
return 0;
2016-09-25 08:29:08 +00:00
}