map.version.pass.cpp 5.6 KB

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