locale.version.pass.cpp 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. // <locale>
  12. // Test the feature test macros defined by <locale>
  13. /* Constant Value
  14. __cpp_lib_char8_t 201811L [C++2a]
  15. */
  16. #include <locale>
  17. #include "test_macros.h"
  18. #if TEST_STD_VER < 14
  19. # ifdef __cpp_lib_char8_t
  20. # error "__cpp_lib_char8_t should not be defined before c++2a"
  21. # endif
  22. #elif TEST_STD_VER == 14
  23. # ifdef __cpp_lib_char8_t
  24. # error "__cpp_lib_char8_t should not be defined before c++2a"
  25. # endif
  26. #elif TEST_STD_VER == 17
  27. # ifdef __cpp_lib_char8_t
  28. # error "__cpp_lib_char8_t should not be defined before c++2a"
  29. # endif
  30. #elif TEST_STD_VER > 17
  31. # if defined(__cpp_char8_t)
  32. # ifndef __cpp_lib_char8_t
  33. # error "__cpp_lib_char8_t should be defined in c++2a"
  34. # endif
  35. # if __cpp_lib_char8_t != 201811L
  36. # error "__cpp_lib_char8_t should have the value 201811L in c++2a"
  37. # endif
  38. # else
  39. # ifdef __cpp_lib_char8_t
  40. # error "__cpp_lib_char8_t should not be defined when defined(__cpp_char8_t) is not defined!"
  41. # endif
  42. # endif
  43. #endif // TEST_STD_VER > 17
  44. int main(int, char**) { return 0; }