2
0

bug_ms_vec_static.cpp 879 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #include <glm/glm.hpp>
  2. #if GLM_CONFIG_ANONYMOUS_STRUCT == GLM_ENABLE
  3. struct vec2;
  4. struct swizzleStruct
  5. {
  6. char _buffer[1];
  7. };
  8. struct vec2
  9. {
  10. GLM_CONSTEXPR vec2() :
  11. x(0), y(0)
  12. {}
  13. #if defined(_MSC_VER)
  14. # pragma warning(push)
  15. # pragma warning(disable: 4201) // nonstandard extension used : nameless struct/union
  16. #endif
  17. #if GLM_COMPILER & GLM_COMPILER_CLANG
  18. # pragma clang diagnostic push
  19. # pragma clang diagnostic ignored "-Wgnu-anonymous-struct"
  20. # pragma clang diagnostic ignored "-Wnested-anon-types"
  21. #endif
  22. union
  23. {
  24. struct { float x, y; };
  25. struct { swizzleStruct xx; };
  26. };
  27. #if GLM_COMPILER & GLM_COMPILER_CLANG
  28. # pragma clang diagnostic pop
  29. #endif
  30. #if defined(_MSC_VER)
  31. # pragma warning(pop)
  32. #endif
  33. };
  34. #endif
  35. // Visual C++ has a bug generating the error: fatal error C1001: An internal error has occurred in the compiler.
  36. // vec2 Bar;
  37. int main()
  38. {
  39. return 0;
  40. }