string.version.pass.cpp 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. // <string> feature macros
  11. /* Constant Value
  12. __cpp_lib_allocator_traits_is_always_equal 201411L
  13. __cpp_lib_erase_if 201811L
  14. __cpp_lib_char8_t 201811L
  15. __cpp_lib_nonmember_container_access 201411L
  16. __cpp_lib_string_udls 201304L
  17. __cpp_lib_string_view 201606L
  18. */
  19. #include <string>
  20. #include <cassert>
  21. #include "test_macros.h"
  22. int main()
  23. {
  24. // ensure that the macros that are supposed to be defined in <string> are defined.
  25. #if TEST_STD_VER > 17
  26. # if !defined(__cpp_lib_erase_if)
  27. LIBCPP_STATIC_ASSERT(false, "__cpp_lib_erase_if is not defined");
  28. # else
  29. # if __cpp_lib_erase_if < 201811L
  30. # error "__cpp_lib_erase_if has an invalid value"
  31. # endif
  32. # endif
  33. #endif
  34. #if TEST_STD_VER > 17 && defined(__cpp_char8_t)
  35. # if !defined(__cpp_lib_char8_t)
  36. LIBCPP_STATIC_ASSERT(false, "__cpp_lib_char8_t is not defined");
  37. # else
  38. # if __cpp_lib_char8_t < 201811L
  39. # error "__cpp_lib_char8_t has an invalid value"
  40. # endif
  41. # endif
  42. #endif
  43. /*
  44. #if !defined(__cpp_lib_fooby)
  45. # error "__cpp_lib_fooby is not defined"
  46. #elif __cpp_lib_fooby < 201606L
  47. # error "__cpp_lib_fooby has an invalid value"
  48. #endif
  49. */
  50. }