shared_mutex.version.pass.cpp 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. // <shared_mutex>
  13. // Test the feature test macros defined by <shared_mutex>
  14. /* Constant Value
  15. __cpp_lib_shared_mutex 201505L [C++17]
  16. __cpp_lib_shared_timed_mutex 201402L [C++14]
  17. */
  18. #include <shared_mutex>
  19. #include "test_macros.h"
  20. #if TEST_STD_VER < 14
  21. # ifdef __cpp_lib_shared_mutex
  22. # error "__cpp_lib_shared_mutex should not be defined before c++17"
  23. # endif
  24. # ifdef __cpp_lib_shared_timed_mutex
  25. # error "__cpp_lib_shared_timed_mutex should not be defined before c++14"
  26. # endif
  27. #elif TEST_STD_VER == 14
  28. # ifdef __cpp_lib_shared_mutex
  29. # error "__cpp_lib_shared_mutex should not be defined before c++17"
  30. # endif
  31. # ifndef __cpp_lib_shared_timed_mutex
  32. # error "__cpp_lib_shared_timed_mutex should be defined in c++14"
  33. # endif
  34. # if __cpp_lib_shared_timed_mutex != 201402L
  35. # error "__cpp_lib_shared_timed_mutex should have the value 201402L in c++14"
  36. # endif
  37. #elif TEST_STD_VER == 17
  38. # ifndef __cpp_lib_shared_mutex
  39. # error "__cpp_lib_shared_mutex should be defined in c++17"
  40. # endif
  41. # if __cpp_lib_shared_mutex != 201505L
  42. # error "__cpp_lib_shared_mutex should have the value 201505L in c++17"
  43. # endif
  44. # ifndef __cpp_lib_shared_timed_mutex
  45. # error "__cpp_lib_shared_timed_mutex should be defined in c++17"
  46. # endif
  47. # if __cpp_lib_shared_timed_mutex != 201402L
  48. # error "__cpp_lib_shared_timed_mutex should have the value 201402L in c++17"
  49. # endif
  50. #elif TEST_STD_VER > 17
  51. # ifndef __cpp_lib_shared_mutex
  52. # error "__cpp_lib_shared_mutex should be defined in c++2a"
  53. # endif
  54. # if __cpp_lib_shared_mutex != 201505L
  55. # error "__cpp_lib_shared_mutex should have the value 201505L in c++2a"
  56. # endif
  57. # ifndef __cpp_lib_shared_timed_mutex
  58. # error "__cpp_lib_shared_timed_mutex should be defined in c++2a"
  59. # endif
  60. # if __cpp_lib_shared_timed_mutex != 201402L
  61. # error "__cpp_lib_shared_timed_mutex should have the value 201402L in c++2a"
  62. # endif
  63. #endif // TEST_STD_VER > 17
  64. int main() {}