utility.version.pass.cpp 5.9 KB

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