tuple.version.pass.cpp 4.6 KB

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