functional.version.pass.cpp 7.5 KB

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