set.version.pass.cpp 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. //===----------------------------------------------------------------------===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. //
  9. // WARNING: This test was generated by generate_feature_test_macro_components.py
  10. // and should not be edited manually.
  11. // <set>
  12. // Test the feature test macros defined by <set>
  13. /* Constant Value
  14. __cpp_lib_allocator_traits_is_always_equal 201411L [C++17]
  15. __cpp_lib_erase_if 201811L [C++2a]
  16. __cpp_lib_generic_associative_lookup 201304L [C++14]
  17. __cpp_lib_node_extract 201606L [C++17]
  18. __cpp_lib_nonmember_container_access 201411L [C++17]
  19. */
  20. #include <set>
  21. #include "test_macros.h"
  22. #if TEST_STD_VER < 14
  23. # ifdef __cpp_lib_allocator_traits_is_always_equal
  24. # error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
  25. # endif
  26. # ifdef __cpp_lib_erase_if
  27. # error "__cpp_lib_erase_if should not be defined before c++2a"
  28. # endif
  29. # ifdef __cpp_lib_generic_associative_lookup
  30. # error "__cpp_lib_generic_associative_lookup should not be defined before c++14"
  31. # endif
  32. # ifdef __cpp_lib_node_extract
  33. # error "__cpp_lib_node_extract should not be defined before c++17"
  34. # endif
  35. # ifdef __cpp_lib_nonmember_container_access
  36. # error "__cpp_lib_nonmember_container_access should not be defined before c++17"
  37. # endif
  38. #elif TEST_STD_VER == 14
  39. # ifdef __cpp_lib_allocator_traits_is_always_equal
  40. # error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
  41. # endif
  42. # ifdef __cpp_lib_erase_if
  43. # error "__cpp_lib_erase_if should not be defined before c++2a"
  44. # endif
  45. # ifndef __cpp_lib_generic_associative_lookup
  46. # error "__cpp_lib_generic_associative_lookup should be defined in c++14"
  47. # endif
  48. # if __cpp_lib_generic_associative_lookup != 201304L
  49. # error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++14"
  50. # endif
  51. # ifdef __cpp_lib_node_extract
  52. # error "__cpp_lib_node_extract should not be defined before c++17"
  53. # endif
  54. # ifdef __cpp_lib_nonmember_container_access
  55. # error "__cpp_lib_nonmember_container_access should not be defined before c++17"
  56. # endif
  57. #elif TEST_STD_VER == 17
  58. # ifndef __cpp_lib_allocator_traits_is_always_equal
  59. # error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++17"
  60. # endif
  61. # if __cpp_lib_allocator_traits_is_always_equal != 201411L
  62. # error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++17"
  63. # endif
  64. # ifdef __cpp_lib_erase_if
  65. # error "__cpp_lib_erase_if should not be defined before c++2a"
  66. # endif
  67. # ifndef __cpp_lib_generic_associative_lookup
  68. # error "__cpp_lib_generic_associative_lookup should be defined in c++17"
  69. # endif
  70. # if __cpp_lib_generic_associative_lookup != 201304L
  71. # error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++17"
  72. # endif
  73. # ifndef __cpp_lib_node_extract
  74. # error "__cpp_lib_node_extract should be defined in c++17"
  75. # endif
  76. # if __cpp_lib_node_extract != 201606L
  77. # error "__cpp_lib_node_extract should have the value 201606L in c++17"
  78. # endif
  79. # ifndef __cpp_lib_nonmember_container_access
  80. # error "__cpp_lib_nonmember_container_access should be defined in c++17"
  81. # endif
  82. # if __cpp_lib_nonmember_container_access != 201411L
  83. # error "__cpp_lib_nonmember_container_access should have the value 201411L in c++17"
  84. # endif
  85. #elif TEST_STD_VER > 17
  86. # ifndef __cpp_lib_allocator_traits_is_always_equal
  87. # error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++2a"
  88. # endif
  89. # if __cpp_lib_allocator_traits_is_always_equal != 201411L
  90. # error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++2a"
  91. # endif
  92. # ifndef __cpp_lib_erase_if
  93. # error "__cpp_lib_erase_if should be defined in c++2a"
  94. # endif
  95. # if __cpp_lib_erase_if != 201811L
  96. # error "__cpp_lib_erase_if should have the value 201811L in c++2a"
  97. # endif
  98. # ifndef __cpp_lib_generic_associative_lookup
  99. # error "__cpp_lib_generic_associative_lookup should be defined in c++2a"
  100. # endif
  101. # if __cpp_lib_generic_associative_lookup != 201304L
  102. # error "__cpp_lib_generic_associative_lookup should have the value 201304L in c++2a"
  103. # endif
  104. # ifndef __cpp_lib_node_extract
  105. # error "__cpp_lib_node_extract should be defined in c++2a"
  106. # endif
  107. # if __cpp_lib_node_extract != 201606L
  108. # error "__cpp_lib_node_extract should have the value 201606L in c++2a"
  109. # endif
  110. # ifndef __cpp_lib_nonmember_container_access
  111. # error "__cpp_lib_nonmember_container_access should be defined in c++2a"
  112. # endif
  113. # if __cpp_lib_nonmember_container_access != 201411L
  114. # error "__cpp_lib_nonmember_container_access should have the value 201411L in c++2a"
  115. # endif
  116. #endif // TEST_STD_VER > 17
  117. int main(int, char**) { return 0; }