utility.version.pass.cpp 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  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. // <utility>
  12. // Test the feature test macros defined by <utility>
  13. /* Constant Value
  14. __cpp_lib_as_const 201510L [C++17]
  15. __cpp_lib_constexpr_misc 201811L [C++2a]
  16. __cpp_lib_exchange_function 201304L [C++14]
  17. __cpp_lib_integer_sequence 201304L [C++14]
  18. __cpp_lib_to_chars 201611L [C++17]
  19. __cpp_lib_tuples_by_type 201304L [C++14]
  20. */
  21. #include <utility>
  22. #include "test_macros.h"
  23. #if TEST_STD_VER < 14
  24. # ifdef __cpp_lib_as_const
  25. # error "__cpp_lib_as_const should not be defined before c++17"
  26. # endif
  27. # ifdef __cpp_lib_constexpr_misc
  28. # error "__cpp_lib_constexpr_misc should not be defined before c++2a"
  29. # endif
  30. # ifdef __cpp_lib_exchange_function
  31. # error "__cpp_lib_exchange_function should not be defined before c++14"
  32. # endif
  33. # ifdef __cpp_lib_integer_sequence
  34. # error "__cpp_lib_integer_sequence should not be defined before c++14"
  35. # endif
  36. # ifdef __cpp_lib_to_chars
  37. # error "__cpp_lib_to_chars should not be defined before c++17"
  38. # endif
  39. # ifdef __cpp_lib_tuples_by_type
  40. # error "__cpp_lib_tuples_by_type should not be defined before c++14"
  41. # endif
  42. #elif TEST_STD_VER == 14
  43. # ifdef __cpp_lib_as_const
  44. # error "__cpp_lib_as_const should not be defined before c++17"
  45. # endif
  46. # ifdef __cpp_lib_constexpr_misc
  47. # error "__cpp_lib_constexpr_misc should not be defined before c++2a"
  48. # endif
  49. # ifndef __cpp_lib_exchange_function
  50. # error "__cpp_lib_exchange_function should be defined in c++14"
  51. # endif
  52. # if __cpp_lib_exchange_function != 201304L
  53. # error "__cpp_lib_exchange_function should have the value 201304L in c++14"
  54. # endif
  55. # ifndef __cpp_lib_integer_sequence
  56. # error "__cpp_lib_integer_sequence should be defined in c++14"
  57. # endif
  58. # if __cpp_lib_integer_sequence != 201304L
  59. # error "__cpp_lib_integer_sequence should have the value 201304L in c++14"
  60. # endif
  61. # ifdef __cpp_lib_to_chars
  62. # error "__cpp_lib_to_chars should not be defined before c++17"
  63. # endif
  64. # ifndef __cpp_lib_tuples_by_type
  65. # error "__cpp_lib_tuples_by_type should be defined in c++14"
  66. # endif
  67. # if __cpp_lib_tuples_by_type != 201304L
  68. # error "__cpp_lib_tuples_by_type should have the value 201304L in c++14"
  69. # endif
  70. #elif TEST_STD_VER == 17
  71. # ifndef __cpp_lib_as_const
  72. # error "__cpp_lib_as_const should be defined in c++17"
  73. # endif
  74. # if __cpp_lib_as_const != 201510L
  75. # error "__cpp_lib_as_const should have the value 201510L in c++17"
  76. # endif
  77. # ifdef __cpp_lib_constexpr_misc
  78. # error "__cpp_lib_constexpr_misc should not be defined before c++2a"
  79. # endif
  80. # ifndef __cpp_lib_exchange_function
  81. # error "__cpp_lib_exchange_function should be defined in c++17"
  82. # endif
  83. # if __cpp_lib_exchange_function != 201304L
  84. # error "__cpp_lib_exchange_function should have the value 201304L in c++17"
  85. # endif
  86. # ifndef __cpp_lib_integer_sequence
  87. # error "__cpp_lib_integer_sequence should be defined in c++17"
  88. # endif
  89. # if __cpp_lib_integer_sequence != 201304L
  90. # error "__cpp_lib_integer_sequence should have the value 201304L in c++17"
  91. # endif
  92. # if !defined(_LIBCPP_VERSION)
  93. # ifndef __cpp_lib_to_chars
  94. # error "__cpp_lib_to_chars should be defined in c++17"
  95. # endif
  96. # if __cpp_lib_to_chars != 201611L
  97. # error "__cpp_lib_to_chars should have the value 201611L in c++17"
  98. # endif
  99. # else // _LIBCPP_VERSION
  100. # ifdef __cpp_lib_to_chars
  101. # error "__cpp_lib_to_chars should not be defined because it is unimplemented in libc++!"
  102. # endif
  103. # endif
  104. # ifndef __cpp_lib_tuples_by_type
  105. # error "__cpp_lib_tuples_by_type should be defined in c++17"
  106. # endif
  107. # if __cpp_lib_tuples_by_type != 201304L
  108. # error "__cpp_lib_tuples_by_type should have the value 201304L in c++17"
  109. # endif
  110. #elif TEST_STD_VER > 17
  111. # ifndef __cpp_lib_as_const
  112. # error "__cpp_lib_as_const should be defined in c++2a"
  113. # endif
  114. # if __cpp_lib_as_const != 201510L
  115. # error "__cpp_lib_as_const should have the value 201510L in c++2a"
  116. # endif
  117. # if !defined(_LIBCPP_VERSION)
  118. # ifndef __cpp_lib_constexpr_misc
  119. # error "__cpp_lib_constexpr_misc should be defined in c++2a"
  120. # endif
  121. # if __cpp_lib_constexpr_misc != 201811L
  122. # error "__cpp_lib_constexpr_misc should have the value 201811L in c++2a"
  123. # endif
  124. # else // _LIBCPP_VERSION
  125. # ifdef __cpp_lib_constexpr_misc
  126. # error "__cpp_lib_constexpr_misc should not be defined because it is unimplemented in libc++!"
  127. # endif
  128. # endif
  129. # ifndef __cpp_lib_exchange_function
  130. # error "__cpp_lib_exchange_function should be defined in c++2a"
  131. # endif
  132. # if __cpp_lib_exchange_function != 201304L
  133. # error "__cpp_lib_exchange_function should have the value 201304L in c++2a"
  134. # endif
  135. # ifndef __cpp_lib_integer_sequence
  136. # error "__cpp_lib_integer_sequence should be defined in c++2a"
  137. # endif
  138. # if __cpp_lib_integer_sequence != 201304L
  139. # error "__cpp_lib_integer_sequence should have the value 201304L in c++2a"
  140. # endif
  141. # if !defined(_LIBCPP_VERSION)
  142. # ifndef __cpp_lib_to_chars
  143. # error "__cpp_lib_to_chars should be defined in c++2a"
  144. # endif
  145. # if __cpp_lib_to_chars != 201611L
  146. # error "__cpp_lib_to_chars should have the value 201611L in c++2a"
  147. # endif
  148. # else // _LIBCPP_VERSION
  149. # ifdef __cpp_lib_to_chars
  150. # error "__cpp_lib_to_chars should not be defined because it is unimplemented in libc++!"
  151. # endif
  152. # endif
  153. # ifndef __cpp_lib_tuples_by_type
  154. # error "__cpp_lib_tuples_by_type should be defined in c++2a"
  155. # endif
  156. # if __cpp_lib_tuples_by_type != 201304L
  157. # error "__cpp_lib_tuples_by_type should have the value 201304L in c++2a"
  158. # endif
  159. #endif // TEST_STD_VER > 17
  160. int main(int, char**) { return 0; }