tuple.version.pass.cpp 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  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. // <tuple>
  12. // Test the feature test macros defined by <tuple>
  13. /* Constant Value
  14. __cpp_lib_apply 201603L [C++17]
  15. __cpp_lib_constexpr_misc 201811L [C++2a]
  16. __cpp_lib_make_from_tuple 201606L [C++17]
  17. __cpp_lib_tuple_element_t 201402L [C++14]
  18. __cpp_lib_tuples_by_type 201304L [C++14]
  19. */
  20. #include <tuple>
  21. #include "test_macros.h"
  22. #if TEST_STD_VER < 14
  23. # ifdef __cpp_lib_apply
  24. # error "__cpp_lib_apply should not be defined before c++17"
  25. # endif
  26. # ifdef __cpp_lib_constexpr_misc
  27. # error "__cpp_lib_constexpr_misc should not be defined before c++2a"
  28. # endif
  29. # ifdef __cpp_lib_make_from_tuple
  30. # error "__cpp_lib_make_from_tuple should not be defined before c++17"
  31. # endif
  32. # ifdef __cpp_lib_tuple_element_t
  33. # error "__cpp_lib_tuple_element_t should not be defined before c++14"
  34. # endif
  35. # ifdef __cpp_lib_tuples_by_type
  36. # error "__cpp_lib_tuples_by_type should not be defined before c++14"
  37. # endif
  38. #elif TEST_STD_VER == 14
  39. # ifdef __cpp_lib_apply
  40. # error "__cpp_lib_apply should not be defined before c++17"
  41. # endif
  42. # ifdef __cpp_lib_constexpr_misc
  43. # error "__cpp_lib_constexpr_misc should not be defined before c++2a"
  44. # endif
  45. # ifdef __cpp_lib_make_from_tuple
  46. # error "__cpp_lib_make_from_tuple should not be defined before c++17"
  47. # endif
  48. # ifndef __cpp_lib_tuple_element_t
  49. # error "__cpp_lib_tuple_element_t should be defined in c++14"
  50. # endif
  51. # if __cpp_lib_tuple_element_t != 201402L
  52. # error "__cpp_lib_tuple_element_t should have the value 201402L in c++14"
  53. # endif
  54. # ifndef __cpp_lib_tuples_by_type
  55. # error "__cpp_lib_tuples_by_type should be defined in c++14"
  56. # endif
  57. # if __cpp_lib_tuples_by_type != 201304L
  58. # error "__cpp_lib_tuples_by_type should have the value 201304L in c++14"
  59. # endif
  60. #elif TEST_STD_VER == 17
  61. # ifndef __cpp_lib_apply
  62. # error "__cpp_lib_apply should be defined in c++17"
  63. # endif
  64. # if __cpp_lib_apply != 201603L
  65. # error "__cpp_lib_apply should have the value 201603L in c++17"
  66. # endif
  67. # ifdef __cpp_lib_constexpr_misc
  68. # error "__cpp_lib_constexpr_misc should not be defined before c++2a"
  69. # endif
  70. # ifndef __cpp_lib_make_from_tuple
  71. # error "__cpp_lib_make_from_tuple should be defined in c++17"
  72. # endif
  73. # if __cpp_lib_make_from_tuple != 201606L
  74. # error "__cpp_lib_make_from_tuple should have the value 201606L in c++17"
  75. # endif
  76. # ifndef __cpp_lib_tuple_element_t
  77. # error "__cpp_lib_tuple_element_t should be defined in c++17"
  78. # endif
  79. # if __cpp_lib_tuple_element_t != 201402L
  80. # error "__cpp_lib_tuple_element_t should have the value 201402L in c++17"
  81. # endif
  82. # ifndef __cpp_lib_tuples_by_type
  83. # error "__cpp_lib_tuples_by_type should be defined in c++17"
  84. # endif
  85. # if __cpp_lib_tuples_by_type != 201304L
  86. # error "__cpp_lib_tuples_by_type should have the value 201304L in c++17"
  87. # endif
  88. #elif TEST_STD_VER > 17
  89. # ifndef __cpp_lib_apply
  90. # error "__cpp_lib_apply should be defined in c++2a"
  91. # endif
  92. # if __cpp_lib_apply != 201603L
  93. # error "__cpp_lib_apply should have the value 201603L in c++2a"
  94. # endif
  95. # if !defined(_LIBCPP_VERSION)
  96. # ifndef __cpp_lib_constexpr_misc
  97. # error "__cpp_lib_constexpr_misc should be defined in c++2a"
  98. # endif
  99. # if __cpp_lib_constexpr_misc != 201811L
  100. # error "__cpp_lib_constexpr_misc should have the value 201811L in c++2a"
  101. # endif
  102. # else // _LIBCPP_VERSION
  103. # ifdef __cpp_lib_constexpr_misc
  104. # error "__cpp_lib_constexpr_misc should not be defined because it is unimplemented in libc++!"
  105. # endif
  106. # endif
  107. # ifndef __cpp_lib_make_from_tuple
  108. # error "__cpp_lib_make_from_tuple should be defined in c++2a"
  109. # endif
  110. # if __cpp_lib_make_from_tuple != 201606L
  111. # error "__cpp_lib_make_from_tuple should have the value 201606L in c++2a"
  112. # endif
  113. # ifndef __cpp_lib_tuple_element_t
  114. # error "__cpp_lib_tuple_element_t should be defined in c++2a"
  115. # endif
  116. # if __cpp_lib_tuple_element_t != 201402L
  117. # error "__cpp_lib_tuple_element_t should have the value 201402L in c++2a"
  118. # endif
  119. # ifndef __cpp_lib_tuples_by_type
  120. # error "__cpp_lib_tuples_by_type should be defined in c++2a"
  121. # endif
  122. # if __cpp_lib_tuples_by_type != 201304L
  123. # error "__cpp_lib_tuples_by_type should have the value 201304L in c++2a"
  124. # endif
  125. #endif // TEST_STD_VER > 17
  126. int main(int, char**) { return 0; }