set.version.pass.cpp 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  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. // <set>
  13. // Test the feature test macros defined by <set>
  14. /* Constant Value
  15. __cpp_lib_allocator_traits_is_always_equal 201411L [C++17]
  16. __cpp_lib_erase_if 201811L [C++2a]
  17. __cpp_lib_generic_associative_lookup 201304L [C++14]
  18. __cpp_lib_node_extract 201606L [C++17]
  19. __cpp_lib_nonmember_container_access 201411L [C++17]
  20. */
  21. #include <set>
  22. #include "test_macros.h"
  23. #if TEST_STD_VER < 14
  24. # ifdef __cpp_lib_allocator_traits_is_always_equal
  25. # error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
  26. # endif
  27. # ifdef __cpp_lib_erase_if
  28. # error "__cpp_lib_erase_if should not be defined before c++2a"
  29. # endif
  30. # ifdef __cpp_lib_generic_associative_lookup
  31. # error "__cpp_lib_generic_associative_lookup should not be defined before c++14"
  32. # endif
  33. # ifdef __cpp_lib_node_extract
  34. # error "__cpp_lib_node_extract should not be defined before c++17"
  35. # endif
  36. # ifdef __cpp_lib_nonmember_container_access
  37. # error "__cpp_lib_nonmember_container_access should not be defined before c++17"
  38. # endif
  39. #elif TEST_STD_VER == 14
  40. # ifdef __cpp_lib_allocator_traits_is_always_equal
  41. # error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
  42. # endif
  43. # ifdef __cpp_lib_erase_if
  44. # error "__cpp_lib_erase_if should not be defined before c++2a"
  45. # endif
  46. # ifndef __cpp_lib_generic_associative_lookup
  47. # error "__cpp_lib_generic_associative_lookup should be defined in c++14"
  48. # endif
  49. # if __cpp_lib_generic_associative_lookup != 201304L
  50. # error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++14"
  51. # endif
  52. # ifdef __cpp_lib_node_extract
  53. # error "__cpp_lib_node_extract should not be defined before c++17"
  54. # endif
  55. # ifdef __cpp_lib_nonmember_container_access
  56. # error "__cpp_lib_nonmember_container_access should not be defined before c++17"
  57. # endif
  58. #elif TEST_STD_VER == 17
  59. # ifndef __cpp_lib_allocator_traits_is_always_equal
  60. # error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++17"
  61. # endif
  62. # if __cpp_lib_allocator_traits_is_always_equal != 201411L
  63. # error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++17"
  64. # endif
  65. # ifdef __cpp_lib_erase_if
  66. # error "__cpp_lib_erase_if should not be defined before c++2a"
  67. # endif
  68. # ifndef __cpp_lib_generic_associative_lookup
  69. # error "__cpp_lib_generic_associative_lookup should be defined in c++17"
  70. # endif
  71. # if __cpp_lib_generic_associative_lookup != 201304L
  72. # error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++17"
  73. # endif
  74. # ifndef __cpp_lib_node_extract
  75. # error "__cpp_lib_node_extract should be defined in c++17"
  76. # endif
  77. # if __cpp_lib_node_extract != 201606L
  78. # error "__cpp_lib_node_extract should have the value 201606L in c++17"
  79. # endif
  80. # ifndef __cpp_lib_nonmember_container_access
  81. # error "__cpp_lib_nonmember_container_access should be defined in c++17"
  82. # endif
  83. # if __cpp_lib_nonmember_container_access != 201411L
  84. # error "__cpp_lib_nonmember_container_access should have the value 201411L in c++17"
  85. # endif
  86. #elif TEST_STD_VER > 17
  87. # ifndef __cpp_lib_allocator_traits_is_always_equal
  88. # error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++2a"
  89. # endif
  90. # if __cpp_lib_allocator_traits_is_always_equal != 201411L
  91. # error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++2a"
  92. # endif
  93. # ifndef __cpp_lib_erase_if
  94. # error "__cpp_lib_erase_if should be defined in c++2a"
  95. # endif
  96. # if __cpp_lib_erase_if != 201811L
  97. # error "__cpp_lib_erase_if should have the value 201811L in c++2a"
  98. # endif
  99. # ifndef __cpp_lib_generic_associative_lookup
  100. # error "__cpp_lib_generic_associative_lookup should be defined in c++2a"
  101. # endif
  102. # if __cpp_lib_generic_associative_lookup != 201304L
  103. # error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++2a"
  104. # endif
  105. # ifndef __cpp_lib_node_extract
  106. # error "__cpp_lib_node_extract should be defined in c++2a"
  107. # endif
  108. # if __cpp_lib_node_extract != 201606L
  109. # error "__cpp_lib_node_extract should have the value 201606L in c++2a"
  110. # endif
  111. # ifndef __cpp_lib_nonmember_container_access
  112. # error "__cpp_lib_nonmember_container_access should be defined in c++2a"
  113. # endif
  114. # if __cpp_lib_nonmember_container_access != 201411L
  115. # error "__cpp_lib_nonmember_container_access should have the value 201411L in c++2a"
  116. # endif
  117. #endif // TEST_STD_VER > 17
  118. int main() {}