version.version.pass.cpp 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  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. // <version> feature macros
  11. /* Constant Value
  12. __cpp_lib_addressof_constexpr 201603L
  13. __cpp_lib_allocator_traits_is_always_equal 201411L
  14. __cpp_lib_any 201606L
  15. __cpp_lib_apply 201603L
  16. __cpp_lib_array_constexpr 201603L
  17. __cpp_lib_as_const 201510L
  18. __cpp_lib_atomic_is_always_lock_free 201603L
  19. __cpp_lib_atomic_ref 201806L
  20. __cpp_lib_bit_cast 201806L
  21. __cpp_lib_bool_constant 201505L
  22. __cpp_lib_boyer_moore_searcher 201603L
  23. __cpp_lib_byte 201603L
  24. __cpp_lib_chrono 201611L
  25. __cpp_lib_clamp 201603L
  26. __cpp_lib_complex_udls 201309L
  27. __cpp_lib_concepts 201806L
  28. __cpp_lib_constexpr_swap_algorithms 201806L
  29. __cpp_lib_enable_shared_from_this 201603L
  30. __cpp_lib_exchange_function 201304L
  31. __cpp_lib_execution 201603L
  32. __cpp_lib_filesystem 201703L
  33. __cpp_lib_gcd_lcm 201606L
  34. __cpp_lib_generic_associative_lookup 201304L
  35. __cpp_lib_hardware_interference_size 201703L
  36. __cpp_lib_has_unique_object_representations 201606L
  37. __cpp_lib_hypot 201603L
  38. __cpp_lib_incomplete_container_elements 201505L
  39. __cpp_lib_integer_sequence 201304L
  40. __cpp_lib_integral_constant_callable 201304L
  41. __cpp_lib_invoke 201411L
  42. __cpp_lib_is_aggregate 201703L
  43. __cpp_lib_is_final 201402L
  44. __cpp_lib_is_invocable 201703L
  45. __cpp_lib_is_null_pointer 201309L
  46. __cpp_lib_is_swappable 201603L
  47. __cpp_lib_launder 201606L
  48. __cpp_lib_list_remove_return_type 201806L
  49. __cpp_lib_logical_traits 201510L
  50. __cpp_lib_make_from_tuple 201606L
  51. __cpp_lib_make_reverse_iterator 201402L
  52. __cpp_lib_make_unique 201304L
  53. __cpp_lib_map_try_emplace 201411L
  54. __cpp_lib_math_special_functions 201603L
  55. __cpp_lib_memory_resource 201603L
  56. __cpp_lib_node_extract 201606L
  57. __cpp_lib_nonmember_container_access 201411L
  58. __cpp_lib_not_fn 201603L
  59. __cpp_lib_null_iterators 201304L
  60. __cpp_lib_optional 201606L
  61. __cpp_lib_parallel_algorithm 201603L
  62. __cpp_lib_quoted_string_io 201304L
  63. __cpp_lib_raw_memory_algorithms 201606L
  64. __cpp_lib_result_of_sfinae 201210L
  65. __cpp_lib_robust_nonmodifying_seq_ops 201304L
  66. __cpp_lib_sample 201603L
  67. __cpp_lib_scoped_lock 201703L
  68. __cpp_lib_shared_mutex 201505L
  69. __cpp_lib_shared_ptr_arrays 201611L
  70. __cpp_lib_shared_ptr_weak_type 201606L
  71. __cpp_lib_shared_timed_mutex 201402L
  72. __cpp_lib_string_udls 201304L
  73. __cpp_lib_string_view 201606L
  74. __cpp_lib_to_chars 201611L
  75. __cpp_lib_transformation_trait_aliases 201304L
  76. __cpp_lib_transparent_operators 201510L
  77. __cpp_lib_tuple_element_t 201402L
  78. __cpp_lib_tuples_by_type 201304L
  79. __cpp_lib_type_trait_variable_templates 201510L
  80. __cpp_lib_uncaught_exceptions 201411L
  81. __cpp_lib_unordered_map_try_emplace 201411L
  82. __cpp_lib_variant 201606L
  83. __cpp_lib_void_t 201411L
  84. */
  85. #include <version>
  86. #include "test_macros.h"
  87. int main()
  88. {
  89. // ensure that the macros that are supposed to be defined in <version> are defined.
  90. #if _TEST_STD_VER > 14
  91. # if !defined(__cpp_lib_atomic_is_always_lock_free)
  92. # error "__cpp_lib_atomic_is_always_lock_free is not defined"
  93. # elif __cpp_lib_atomic_is_always_lock_free < 201603L
  94. # error "__cpp_lib_atomic_is_always_lock_free has an invalid value"
  95. # endif
  96. #endif
  97. #if _TEST_STD_VER > 14
  98. # if !defined(__cpp_lib_filesystem)
  99. # error "__cpp_lib_filesystem is not defined"
  100. # elif __cpp_lib_filesystem < 201703L
  101. # error "__cpp_lib_filesystem has an invalid value"
  102. # endif
  103. #endif
  104. #if _TEST_STD_VER > 14
  105. # if !defined(__cpp_lib_invoke)
  106. # error "__cpp_lib_invoke is not defined"
  107. # elif __cpp_lib_invoke < 201411L
  108. # error "__cpp_lib_invoke has an invalid value"
  109. # endif
  110. #endif
  111. #if _TEST_STD_VER > 14
  112. # if !defined(__cpp_lib_void_t)
  113. # error "__cpp_lib_void_t is not defined"
  114. # elif __cpp_lib_void_t < 201411L
  115. # error "__cpp_lib_void_t has an invalid value"
  116. # endif
  117. #endif
  118. /*
  119. #if !defined(__cpp_lib_fooby)
  120. # error "__cpp_lib_fooby is not defined"
  121. #elif __cpp_lib_fooby < 201606L
  122. # error "__cpp_lib_fooby has an invalid value"
  123. #endif
  124. */
  125. }