| 1 |
// { dg-do compile { target c++17 } } |
| 2 |
// { dg-require-effective-target hosted } |
| 3 |
// { dg-add-options no_pch } |
| 4 |
|
| 5 |
#include <version> |
| 6 |
|
| 7 |
#ifndef __cpp_lib_constexpr_string |
| 8 |
# error "Feature-test macro for constexpr std::string missing in <version>" |
| 9 |
#endif |
| 10 |
|
| 11 |
#if __cplusplus == 201703L |
| 12 |
# if __cpp_lib_constexpr_string != 201611L |
| 13 |
# error "Feature-test macro for constexpr std::string has wrong value for C++17 in <version>" |
| 14 |
# endif |
| 15 |
#endif |
| 16 |
|
| 17 |
#if __cplusplus == 202002L |
| 18 |
# if _GLIBCXX_USE_CXX11_ABI |
| 19 |
# if __cpp_lib_constexpr_string != 201907L |
| 20 |
# error "Feature-test macro for constexpr std::string has wrong value for C++20 in <version>" |
| 21 |
# endif |
| 22 |
# else // COW strings |
| 23 |
# if __cpp_lib_constexpr_string != 201811L |
| 24 |
# error "Feature-test macro for constexpr std::string has wrong value for C++20 in <version>" |
| 25 |
# endif |
| 26 |
# endif |
| 27 |
#endif |