functional.version.pass.cpp 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  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. // <functional>
  12. // Test the feature test macros defined by <functional>
  13. /* Constant Value
  14. __cpp_lib_bind_front 201811L [C++2a]
  15. __cpp_lib_boyer_moore_searcher 201603L [C++17]
  16. __cpp_lib_constexpr_misc 201811L [C++2a]
  17. __cpp_lib_invoke 201411L [C++17]
  18. __cpp_lib_not_fn 201603L [C++17]
  19. __cpp_lib_ranges 201811L [C++2a]
  20. __cpp_lib_result_of_sfinae 201210L [C++14]
  21. __cpp_lib_transparent_operators 201210L [C++14]
  22. 201510L [C++17]
  23. */
  24. #include <functional>
  25. #include "test_macros.h"
  26. #if TEST_STD_VER < 14
  27. # ifdef __cpp_lib_bind_front
  28. # error "__cpp_lib_bind_front should not be defined before c++2a"
  29. # endif
  30. # ifdef __cpp_lib_boyer_moore_searcher
  31. # error "__cpp_lib_boyer_moore_searcher should not be defined before c++17"
  32. # endif
  33. # ifdef __cpp_lib_constexpr_misc
  34. # error "__cpp_lib_constexpr_misc should not be defined before c++2a"
  35. # endif
  36. # ifdef __cpp_lib_invoke
  37. # error "__cpp_lib_invoke should not be defined before c++17"
  38. # endif
  39. # ifdef __cpp_lib_not_fn
  40. # error "__cpp_lib_not_fn should not be defined before c++17"
  41. # endif
  42. # ifdef __cpp_lib_ranges
  43. # error "__cpp_lib_ranges should not be defined before c++2a"
  44. # endif
  45. # ifdef __cpp_lib_result_of_sfinae
  46. # error "__cpp_lib_result_of_sfinae should not be defined before c++14"
  47. # endif
  48. # ifdef __cpp_lib_transparent_operators
  49. # error "__cpp_lib_transparent_operators should not be defined before c++14"
  50. # endif
  51. #elif TEST_STD_VER == 14
  52. # ifdef __cpp_lib_bind_front
  53. # error "__cpp_lib_bind_front should not be defined before c++2a"
  54. # endif
  55. # ifdef __cpp_lib_boyer_moore_searcher
  56. # error "__cpp_lib_boyer_moore_searcher should not be defined before c++17"
  57. # endif
  58. # ifdef __cpp_lib_constexpr_misc
  59. # error "__cpp_lib_constexpr_misc should not be defined before c++2a"
  60. # endif
  61. # ifdef __cpp_lib_invoke
  62. # error "__cpp_lib_invoke should not be defined before c++17"
  63. # endif
  64. # ifdef __cpp_lib_not_fn
  65. # error "__cpp_lib_not_fn should not be defined before c++17"
  66. # endif
  67. # ifdef __cpp_lib_ranges
  68. # error "__cpp_lib_ranges should not be defined before c++2a"
  69. # endif
  70. # ifndef __cpp_lib_result_of_sfinae
  71. # error "__cpp_lib_result_of_sfinae should be defined in c++14"
  72. # endif
  73. # if __cpp_lib_result_of_sfinae != 201210L
  74. # error "__cpp_lib_result_of_sfinae should have the value 201210L in c++14"
  75. # endif
  76. # ifndef __cpp_lib_transparent_operators
  77. # error "__cpp_lib_transparent_operators should be defined in c++14"
  78. # endif
  79. # if __cpp_lib_transparent_operators != 201210L
  80. # error "__cpp_lib_transparent_operators should have the value 201210L in c++14"
  81. # endif
  82. #elif TEST_STD_VER == 17
  83. # ifdef __cpp_lib_bind_front
  84. # error "__cpp_lib_bind_front should not be defined before c++2a"
  85. # endif
  86. # if !defined(_LIBCPP_VERSION)
  87. # ifndef __cpp_lib_boyer_moore_searcher
  88. # error "__cpp_lib_boyer_moore_searcher should be defined in c++17"
  89. # endif
  90. # if __cpp_lib_boyer_moore_searcher != 201603L
  91. # error "__cpp_lib_boyer_moore_searcher should have the value 201603L in c++17"
  92. # endif
  93. # else // _LIBCPP_VERSION
  94. # ifdef __cpp_lib_boyer_moore_searcher
  95. # error "__cpp_lib_boyer_moore_searcher should not be defined because it is unimplemented in libc++!"
  96. # endif
  97. # endif
  98. # ifdef __cpp_lib_constexpr_misc
  99. # error "__cpp_lib_constexpr_misc should not be defined before c++2a"
  100. # endif
  101. # ifndef __cpp_lib_invoke
  102. # error "__cpp_lib_invoke should be defined in c++17"
  103. # endif
  104. # if __cpp_lib_invoke != 201411L
  105. # error "__cpp_lib_invoke should have the value 201411L in c++17"
  106. # endif
  107. # ifndef __cpp_lib_not_fn
  108. # error "__cpp_lib_not_fn should be defined in c++17"
  109. # endif
  110. # if __cpp_lib_not_fn != 201603L
  111. # error "__cpp_lib_not_fn should have the value 201603L in c++17"
  112. # endif
  113. # ifdef __cpp_lib_ranges
  114. # error "__cpp_lib_ranges should not be defined before c++2a"
  115. # endif
  116. # ifndef __cpp_lib_result_of_sfinae
  117. # error "__cpp_lib_result_of_sfinae should be defined in c++17"
  118. # endif
  119. # if __cpp_lib_result_of_sfinae != 201210L
  120. # error "__cpp_lib_result_of_sfinae should have the value 201210L in c++17"
  121. # endif
  122. # ifndef __cpp_lib_transparent_operators
  123. # error "__cpp_lib_transparent_operators should be defined in c++17"
  124. # endif
  125. # if __cpp_lib_transparent_operators != 201510L
  126. # error "__cpp_lib_transparent_operators should have the value 201510L in c++17"
  127. # endif
  128. #elif TEST_STD_VER > 17
  129. # if !defined(_LIBCPP_VERSION)
  130. # ifndef __cpp_lib_bind_front
  131. # error "__cpp_lib_bind_front should be defined in c++2a"
  132. # endif
  133. # if __cpp_lib_bind_front != 201811L
  134. # error "__cpp_lib_bind_front should have the value 201811L in c++2a"
  135. # endif
  136. # else // _LIBCPP_VERSION
  137. # ifdef __cpp_lib_bind_front
  138. # error "__cpp_lib_bind_front should not be defined because it is unimplemented in libc++!"
  139. # endif
  140. # endif
  141. # if !defined(_LIBCPP_VERSION)
  142. # ifndef __cpp_lib_boyer_moore_searcher
  143. # error "__cpp_lib_boyer_moore_searcher should be defined in c++2a"
  144. # endif
  145. # if __cpp_lib_boyer_moore_searcher != 201603L
  146. # error "__cpp_lib_boyer_moore_searcher should have the value 201603L in c++2a"
  147. # endif
  148. # else // _LIBCPP_VERSION
  149. # ifdef __cpp_lib_boyer_moore_searcher
  150. # error "__cpp_lib_boyer_moore_searcher should not be defined because it is unimplemented in libc++!"
  151. # endif
  152. # endif
  153. # if !defined(_LIBCPP_VERSION)
  154. # ifndef __cpp_lib_constexpr_misc
  155. # error "__cpp_lib_constexpr_misc should be defined in c++2a"
  156. # endif
  157. # if __cpp_lib_constexpr_misc != 201811L
  158. # error "__cpp_lib_constexpr_misc should have the value 201811L in c++2a"
  159. # endif
  160. # else // _LIBCPP_VERSION
  161. # ifdef __cpp_lib_constexpr_misc
  162. # error "__cpp_lib_constexpr_misc should not be defined because it is unimplemented in libc++!"
  163. # endif
  164. # endif
  165. # ifndef __cpp_lib_invoke
  166. # error "__cpp_lib_invoke should be defined in c++2a"
  167. # endif
  168. # if __cpp_lib_invoke != 201411L
  169. # error "__cpp_lib_invoke should have the value 201411L in c++2a"
  170. # endif
  171. # ifndef __cpp_lib_not_fn
  172. # error "__cpp_lib_not_fn should be defined in c++2a"
  173. # endif
  174. # if __cpp_lib_not_fn != 201603L
  175. # error "__cpp_lib_not_fn should have the value 201603L in c++2a"
  176. # endif
  177. # if !defined(_LIBCPP_VERSION)
  178. # ifndef __cpp_lib_ranges
  179. # error "__cpp_lib_ranges should be defined in c++2a"
  180. # endif
  181. # if __cpp_lib_ranges != 201811L
  182. # error "__cpp_lib_ranges should have the value 201811L in c++2a"
  183. # endif
  184. # else // _LIBCPP_VERSION
  185. # ifdef __cpp_lib_ranges
  186. # error "__cpp_lib_ranges should not be defined because it is unimplemented in libc++!"
  187. # endif
  188. # endif
  189. # ifndef __cpp_lib_result_of_sfinae
  190. # error "__cpp_lib_result_of_sfinae should be defined in c++2a"
  191. # endif
  192. # if __cpp_lib_result_of_sfinae != 201210L
  193. # error "__cpp_lib_result_of_sfinae should have the value 201210L in c++2a"
  194. # endif
  195. # ifndef __cpp_lib_transparent_operators
  196. # error "__cpp_lib_transparent_operators should be defined in c++2a"
  197. # endif
  198. # if __cpp_lib_transparent_operators != 201510L
  199. # error "__cpp_lib_transparent_operators should have the value 201510L in c++2a"
  200. # endif
  201. #endif // TEST_STD_VER > 17
  202. int main(int, char**) { return 0; }