vector.version.pass.cpp 4.1 KB

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