]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Disable parts of new test that depend on constexpr std::string
authorJonathan Wakely <jwakely@redhat.com>
Thu, 24 Oct 2024 19:12:08 +0000 (20:12 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Fri, 25 Oct 2024 09:23:56 +0000 (10:23 +0100)
The compile-time assertions don't work with -D_GLIBCXX_USE_CXX11_ABI=0.

libstdc++-v3/ChangeLog:

* testsuite/21_strings/basic_string/operators/char/op_plus_string_view.cc:
Check __cpp_lib_constexpr_string.

libstdc++-v3/testsuite/21_strings/basic_string/operators/char/op_plus_string_view.cc

index 364d5bd5abab0e298b4ec38e590abd0f754e3e1e..2d474519f60a010a88e02fe29fe8ca880260f4d4 100644 (file)
@@ -44,6 +44,7 @@ struct convertible_to_lots
   constexpr operator std::string() const { return "convertible_to_lots3"; }
 };
 
+#if __cpp_lib_constexpr_string >= 201907 // constexpr std::string
 using namespace std::literals;
 static_assert( "costa "s + "marbella"sv == "costa marbella"s );
 static_assert( "costa "sv + "marbella"s == "costa marbella"s );
@@ -52,6 +53,7 @@ static_assert( "costa "s + convertible_to_string_view2{} == "costa convertible_t
 static_assert( "costa "s + convertible_to_string_view3{} == "costa convertible_to_sv3 non_const"s );
 static_assert( "costa "s + convertible_to_string_view_and_char_star{} == "costa convertible_to_sv_and_charstar1"s );
 static_assert( "costa "s + convertible_to_lots{} == "costa convertible_to_lots1"s );
+#endif // __cpp_lib_constexpr_string
 
 void
 test01()