filesystem.version.pass.cpp 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. //===----------------------------------------------------------------------===//
  2. //
  3. // The LLVM Compiler Infrastructure
  4. //
  5. // This file is dual licensed under the MIT and the University of Illinois Open
  6. // Source Licenses. See LICENSE.TXT for details.
  7. //
  8. //===----------------------------------------------------------------------===//
  9. //
  10. // WARNING: This test was generated by generate_feature_test_macros_tests.py and
  11. // should not be edited manually.
  12. // <filesystem>
  13. // Test the feature test macros defined by <filesystem>
  14. /* Constant Value
  15. __cpp_lib_char8_t 201811L [C++2a]
  16. __cpp_lib_filesystem 201703L [C++17]
  17. */
  18. #include <filesystem>
  19. #include "test_macros.h"
  20. #if TEST_STD_VER < 14
  21. # ifdef __cpp_lib_char8_t
  22. # error "__cpp_lib_char8_t should not be defined before c++2a"
  23. # endif
  24. # ifdef __cpp_lib_filesystem
  25. # error "__cpp_lib_filesystem should not be defined before c++17"
  26. # endif
  27. #elif TEST_STD_VER == 14
  28. # ifdef __cpp_lib_char8_t
  29. # error "__cpp_lib_char8_t should not be defined before c++2a"
  30. # endif
  31. # ifdef __cpp_lib_filesystem
  32. # error "__cpp_lib_filesystem should not be defined before c++17"
  33. # endif
  34. #elif TEST_STD_VER == 17
  35. # ifdef __cpp_lib_char8_t
  36. # error "__cpp_lib_char8_t should not be defined before c++2a"
  37. # endif
  38. # ifndef __cpp_lib_filesystem
  39. # error "__cpp_lib_filesystem should be defined in c++17"
  40. # endif
  41. # if __cpp_lib_filesystem != 201703L
  42. # error "__cpp_lib_filesystem should have the value 201703L in c++17"
  43. # endif
  44. #elif TEST_STD_VER > 17
  45. # if defined(__cpp_char8_t)
  46. # ifndef __cpp_lib_char8_t
  47. # error "__cpp_lib_char8_t should be defined in c++2a"
  48. # endif
  49. # if __cpp_lib_char8_t != 201811L
  50. # error "__cpp_lib_char8_t should have the value 201811L in c++2a"
  51. # endif
  52. # else
  53. # ifdef __cpp_lib_char8_t
  54. # error "__cpp_lib_char8_t should not be defined when defined(__cpp_char8_t) is not defined!"
  55. # endif
  56. # endif
  57. # ifndef __cpp_lib_filesystem
  58. # error "__cpp_lib_filesystem should be defined in c++2a"
  59. # endif
  60. # if __cpp_lib_filesystem != 201703L
  61. # error "__cpp_lib_filesystem should have the value 201703L in c++2a"
  62. # endif
  63. #endif // TEST_STD_VER > 17
  64. int main() {}