vector.version.pass.cpp 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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. // <vector>
  13. // Test the feature test macros defined by <vector>
  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_incomplete_container_elements 201505L [C++17]
  18. __cpp_lib_nonmember_container_access 201411L [C++17]
  19. */
  20. #include <vector>
  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_incomplete_container_elements
  30. # error "__cpp_lib_incomplete_container_elements should not be defined before c++17"
  31. # endif
  32. # ifdef __cpp_lib_nonmember_container_access
  33. # error "__cpp_lib_nonmember_container_access should not be defined before c++17"
  34. # endif
  35. #elif TEST_STD_VER == 14
  36. # ifdef __cpp_lib_allocator_traits_is_always_equal
  37. # error "__cpp_lib_allocator_traits_is_always_equal should not be defined before c++17"
  38. # endif
  39. # ifdef __cpp_lib_erase_if
  40. # error "__cpp_lib_erase_if should not be defined before c++2a"
  41. # endif
  42. # ifdef __cpp_lib_incomplete_container_elements
  43. # error "__cpp_lib_incomplete_container_elements should not be defined before c++17"
  44. # endif
  45. # ifdef __cpp_lib_nonmember_container_access
  46. # error "__cpp_lib_nonmember_container_access should not be defined before c++17"
  47. # endif
  48. #elif TEST_STD_VER == 17
  49. # ifndef __cpp_lib_allocator_traits_is_always_equal
  50. # error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++17"
  51. # endif
  52. # if __cpp_lib_allocator_traits_is_always_equal != 201411L
  53. # error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++17"
  54. # endif
  55. # ifdef __cpp_lib_erase_if
  56. # error "__cpp_lib_erase_if should not be defined before c++2a"
  57. # endif
  58. # ifndef __cpp_lib_incomplete_container_elements
  59. # error "__cpp_lib_incomplete_container_elements should be defined in c++17"
  60. # endif
  61. # if __cpp_lib_incomplete_container_elements != 201505L
  62. # error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++17"
  63. # endif
  64. # ifndef __cpp_lib_nonmember_container_access
  65. # error "__cpp_lib_nonmember_container_access should be defined in c++17"
  66. # endif
  67. # if __cpp_lib_nonmember_container_access != 201411L
  68. # error "__cpp_lib_nonmember_container_access should have the value 201411L in c++17"
  69. # endif
  70. #elif TEST_STD_VER > 17
  71. # ifndef __cpp_lib_allocator_traits_is_always_equal
  72. # error "__cpp_lib_allocator_traits_is_always_equal should be defined in c++2a"
  73. # endif
  74. # if __cpp_lib_allocator_traits_is_always_equal != 201411L
  75. # error "__cpp_lib_allocator_traits_is_always_equal should have the value 201411L in c++2a"
  76. # endif
  77. # ifndef __cpp_lib_erase_if
  78. # error "__cpp_lib_erase_if should be defined in c++2a"
  79. # endif
  80. # if __cpp_lib_erase_if != 201811L
  81. # error "__cpp_lib_erase_if should have the value 201811L in c++2a"
  82. # endif
  83. # ifndef __cpp_lib_incomplete_container_elements
  84. # error "__cpp_lib_incomplete_container_elements should be defined in c++2a"
  85. # endif
  86. # if __cpp_lib_incomplete_container_elements != 201505L
  87. # error "__cpp_lib_incomplete_container_elements should have the value 201505L in c++2a"
  88. # endif
  89. # ifndef __cpp_lib_nonmember_container_access
  90. # error "__cpp_lib_nonmember_container_access should be defined in c++2a"
  91. # endif
  92. # if __cpp_lib_nonmember_container_access != 201411L
  93. # error "__cpp_lib_nonmember_container_access should have the value 201411L in c++2a"
  94. # endif
  95. #endif // TEST_STD_VER > 17
  96. int main() {}