]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Fix tests that fail with -fno-char8_t
authorJonathan Wakely <jwakely@redhat.com>
Tue, 2 Apr 2024 19:53:11 +0000 (20:53 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Mon, 8 Apr 2024 16:44:18 +0000 (17:44 +0100)
Adjust expected errors or skip tests as UNSUPPORTED if -fno-char8_t is
used in the test flags.

libstdc++-v3/ChangeLog:

* testsuite/20_util/integer_comparisons/equal_neg.cc: Use
no-opts selector for errors that depend on -fchar8_t.
* testsuite/20_util/integer_comparisons/greater_equal_neg.cc:
Likewise.
* testsuite/20_util/integer_comparisons/greater_neg.cc:
Likewise.
* testsuite/20_util/integer_comparisons/in_range_neg.cc:
Likewise.
* testsuite/20_util/integer_comparisons/less_equal_neg.cc:
Likewise.
* testsuite/20_util/integer_comparisons/less_neg.cc: Likewise.
* testsuite/20_util/integer_comparisons/not_equal_neg.cc:
Likewise.
* testsuite/21_strings/basic_string/hash/hash_char8_t.cc: Skip
if -fno-char8_t is used.
* testsuite/21_strings/headers/cuchar/functions_std_cxx20.cc:
Likewise.
* testsuite/27_io/basic_ostream/inserters_character/char/deleted.cc:
Likewise.
* testsuite/27_io/basic_ostream/inserters_character/wchar_t/deleted.cc:
Likewise.
* testsuite/27_io/filesystem/path/factory/u8path-depr.cc: Use
char for u8 literal if char8_t is not available.
* testsuite/27_io/headers/iosfwd/synopsis.cc: Check
__cpp_char8_t.
* testsuite/29_atomics/atomic_integral/wait_notify.cc: Likewise.
* testsuite/29_atomics/headers/atomic/types_std_c++20_neg.cc:
Remove check for _GLIBCXX_USE_CHAR8_T.

15 files changed:
libstdc++-v3/testsuite/20_util/integer_comparisons/equal_neg.cc
libstdc++-v3/testsuite/20_util/integer_comparisons/greater_equal_neg.cc
libstdc++-v3/testsuite/20_util/integer_comparisons/greater_neg.cc
libstdc++-v3/testsuite/20_util/integer_comparisons/in_range_neg.cc
libstdc++-v3/testsuite/20_util/integer_comparisons/less_equal_neg.cc
libstdc++-v3/testsuite/20_util/integer_comparisons/less_neg.cc
libstdc++-v3/testsuite/20_util/integer_comparisons/not_equal_neg.cc
libstdc++-v3/testsuite/21_strings/basic_string/hash/hash_char8_t.cc
libstdc++-v3/testsuite/21_strings/headers/cuchar/functions_std_cxx20.cc
libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/char/deleted.cc
libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/wchar_t/deleted.cc
libstdc++-v3/testsuite/27_io/filesystem/path/factory/u8path-depr.cc
libstdc++-v3/testsuite/27_io/headers/iosfwd/synopsis.cc
libstdc++-v3/testsuite/29_atomics/atomic_integral/wait_notify.cc
libstdc++-v3/testsuite/29_atomics/headers/atomic/types_std_c++20_neg.cc

index 06cfd6ee8f4f91a3c3398dcab572ff6ca08088d8..7290e9e241763af1e893d6db71b7d564f1126415 100644 (file)
@@ -25,8 +25,8 @@ bool c = std::cmp_equal(2, L'2'); // { dg-error "here" }
 bool d = std::cmp_equal(L'2', 2); // { dg-error "here" }
 bool e = std::cmp_equal(true, 1); // { dg-error "here" }
 bool f = std::cmp_equal(0, false); // { dg-error "here" }
-bool g = std::cmp_equal(97, u8'a'); // { dg-error "here" }
-bool h = std::cmp_equal(u8'a', 97); // { dg-error "here" }
+bool g = std::cmp_equal(97, u8'a'); // { dg-error "here" "" { target { no-opts "-fno-char8_t" } } }
+bool h = std::cmp_equal(u8'a', 97); // { dg-error "here" "" { target { no-opts "-fno-char8_t" } } }
 bool i = std::cmp_equal(97, u'a'); // { dg-error "here" }
 bool j = std::cmp_equal(u'a', 97); // { dg-error "here" }
 bool k = std::cmp_equal(97, U'a'); // { dg-error "here" }
index b5f03b70733f77cd36306f31d1c4b20c67301116..cb60bfe9d077f5b12f0d300fdeee950e68f29793 100644 (file)
@@ -25,8 +25,8 @@ bool c = std::cmp_greater_equal(2, L'2'); // { dg-error "constexpr" }
 bool d = std::cmp_greater_equal(L'2', 2); // { dg-error "constexpr" }
 bool e = std::cmp_greater_equal(true, 1); // { dg-error "constexpr" }
 bool f = std::cmp_greater_equal(0, false); // { dg-error "constexpr" }
-bool g = std::cmp_greater_equal(97, u8'a'); // { dg-error "constexpr" }
-bool h = std::cmp_greater_equal(u8'a', 97); // { dg-error "constexpr" }
+bool g = std::cmp_greater_equal(97, u8'a'); // { dg-error "constexpr" "" { target { no-opts "-fno-char8_t" } } }
+bool h = std::cmp_greater_equal(u8'a', 97); // { dg-error "constexpr" "" { target { no-opts "-fno-char8_t" } } }
 bool i = std::cmp_greater_equal(97, u'a'); // { dg-error "constexpr" }
 bool j = std::cmp_greater_equal(u'a', 97); // { dg-error "constexpr" }
 bool k = std::cmp_greater_equal(97, U'a'); // { dg-error "constexpr" }
index 676a03b47fd8d3b2e449d647e2b064c264700bde..d5ff52cee54afdc7a5e4b53e78271eef2c9a1cad 100644 (file)
@@ -25,8 +25,8 @@ bool c = std::cmp_greater(2, L'2'); // { dg-error "constexpr" }
 bool d = std::cmp_greater(L'2', 2); // { dg-error "constexpr" }
 bool e = std::cmp_greater(true, 1); // { dg-error "constexpr" }
 bool f = std::cmp_greater(0, false); // { dg-error "constexpr" }
-bool g = std::cmp_greater(97, u8'a'); // { dg-error "constexpr" }
-bool h = std::cmp_greater(u8'a', 97); // { dg-error "constexpr" }
+bool g = std::cmp_greater(97, u8'a'); // { dg-error "constexpr" "" { target { no-opts "-fno-char8_t" } } }
+bool h = std::cmp_greater(u8'a', 97); // { dg-error "constexpr" "" { target { no-opts "-fno-char8_t" } } }
 bool i = std::cmp_greater(97, u'a'); // { dg-error "constexpr" }
 bool j = std::cmp_greater(u'a', 97); // { dg-error "constexpr" }
 bool k = std::cmp_greater(97, U'a'); // { dg-error "constexpr" }
index a6b071aed77b5fb1e6a8b4145d709155e4093db4..bf50abe356a1ab11be0e2c68d396533b2a273e7f 100644 (file)
@@ -25,8 +25,10 @@ bool c = std::in_range<int>(L'2'); // { dg-error "here" }
 bool d = std::in_range<wchar_t>(2); // { dg-error "here" }
 bool e = std::in_range<int>(true); // { dg-error "here" }
 bool f = std::in_range<bool>(0); // { dg-error "here" }
-bool g = std::in_range<int>(u8'a'); // { dg-error "here" }
-bool h = std::in_range<char8_t>(97); // { dg-error "here" }
+bool g = std::in_range<int>(u8'a'); // { dg-error "here" "" { target { no-opts "-fno-char8_t" } } }
+#ifdef __cpp_char8_t
+bool h = std::in_range<char8_t>(97); // { dg-error "here" "" { target { no-opts "-fno-char8_t" } } }
+#endif
 bool i = std::in_range<int>(u'a'); // { dg-error "here" }
 bool j = std::in_range<char16_t>(97); // { dg-error "here" }
 bool k = std::in_range<int>(U'a'); // { dg-error "here" }
index ce8f3b5d9ce0219b75cb72127c43c3a19f3b07d4..f15acb9ec3d18c26a848513d8a041564fa177878 100644 (file)
@@ -25,8 +25,8 @@ bool c = std::cmp_less_equal(2, L'2'); // { dg-error "constexpr" }
 bool d = std::cmp_less_equal(L'2', 2); // { dg-error "constexpr" }
 bool e = std::cmp_less_equal(true, 1); // { dg-error "constexpr" }
 bool f = std::cmp_less_equal(0, false); // { dg-error "constexpr" }
-bool g = std::cmp_less_equal(97, u8'a'); // { dg-error "constexpr" }
-bool h = std::cmp_less_equal(u8'a', 97); // { dg-error "constexpr" }
+bool g = std::cmp_less_equal(97, u8'a'); // { dg-error "constexpr" "" { target { no-opts "-fno-char8_t" } } }
+bool h = std::cmp_less_equal(u8'a', 97); // { dg-error "constexpr" "" { target { no-opts "-fno-char8_t" } } }
 bool i = std::cmp_less_equal(97, u'a'); // { dg-error "constexpr" }
 bool j = std::cmp_less_equal(u'a', 97); // { dg-error "constexpr" }
 bool k = std::cmp_less_equal(97, U'a'); // { dg-error "constexpr" }
index 4bc9bfe0af2cab49b4193563ccf9be6d25a3765a..2d08662f8d86fed04626b2a712ce23e3d7e4cef0 100644 (file)
@@ -25,8 +25,8 @@ bool c = std::cmp_less(2, L'2'); // { dg-error "here" }
 bool d = std::cmp_less(L'2', 2); // { dg-error "here" }
 bool e = std::cmp_less(true, 1); // { dg-error "here" }
 bool f = std::cmp_less(0, false); // { dg-error "here" }
-bool g = std::cmp_less(97, u8'a'); // { dg-error "here" }
-bool h = std::cmp_less(u8'a', 97); // { dg-error "here" }
+bool g = std::cmp_less(97, u8'a'); // { dg-error "here" "" { target { no-opts "-fno-char8_t" } } }
+bool h = std::cmp_less(u8'a', 97); // { dg-error "here" "" { target { no-opts "-fno-char8_t" } } }
 bool i = std::cmp_less(97, u'a'); // { dg-error "here" }
 bool j = std::cmp_less(u'a', 97); // { dg-error "here" }
 bool k = std::cmp_less(97, U'a'); // { dg-error "here" }
index 06cfd6ee8f4f91a3c3398dcab572ff6ca08088d8..7290e9e241763af1e893d6db71b7d564f1126415 100644 (file)
@@ -25,8 +25,8 @@ bool c = std::cmp_equal(2, L'2'); // { dg-error "here" }
 bool d = std::cmp_equal(L'2', 2); // { dg-error "here" }
 bool e = std::cmp_equal(true, 1); // { dg-error "here" }
 bool f = std::cmp_equal(0, false); // { dg-error "here" }
-bool g = std::cmp_equal(97, u8'a'); // { dg-error "here" }
-bool h = std::cmp_equal(u8'a', 97); // { dg-error "here" }
+bool g = std::cmp_equal(97, u8'a'); // { dg-error "here" "" { target { no-opts "-fno-char8_t" } } }
+bool h = std::cmp_equal(u8'a', 97); // { dg-error "here" "" { target { no-opts "-fno-char8_t" } } }
 bool i = std::cmp_equal(97, u'a'); // { dg-error "here" }
 bool j = std::cmp_equal(u'a', 97); // { dg-error "here" }
 bool k = std::cmp_equal(97, U'a'); // { dg-error "here" }
index 1ef487187216c16583be9e38b74409121afabb09..8cd603da17fb6f07e997d45ae77743d791e64e18 100644 (file)
@@ -16,6 +16,7 @@
 // <http://www.gnu.org/licenses/>.
 
 // { dg-do run { target c++20 } }
+// { dg-skip-if "" { *-*-* } { "-fno-char8_t" } }
 
 #include <string>
 #include <memory_resource>
index 1964803cbd1b861a4f2e15478260486aba3e09ba..71c62e982034740ff9db33eff691006eb6b480dc 100644 (file)
@@ -1,4 +1,5 @@
 // { dg-do compile { target c++20 } }
+// { dg-skip-if "" { *-*-* } { "-fno-char8_t" } }
 
 #include <cuchar>
 
index e57bda8ecc1c9676930f6cb7f5d002ffe39c87f5..95f4aeb010e05a897b86f3d7c9fcb12a6b59cfc3 100644 (file)
@@ -20,6 +20,7 @@
 // Test character inserters defined as deleted by P1423.
 
 // { dg-do compile { target c++20 } }
+// { dg-skip-if "" { *-*-* } { "-fno-char8_t" } }
 
 #include <ostream>
 
index 89b560418a1f3a1cca9bb9d7ce08a50d25e4d11f..5203dd6e1ce2002b7f68efceab08c2ad8092e431 100644 (file)
@@ -20,6 +20,7 @@
 // Test wide character inserters defined as deleted by P1423.
 
 // { dg-do compile { target c++20 } }
+// { dg-skip-if "" { *-*-* } { "-fno-char8_t" } }
 
 #include <ostream>
 
index ffa59979ec99219eb9660b9a6f8e3df3c872c2cd..48827ea44cfce53fbcb5dee816e9a4670c68f01b 100644 (file)
@@ -10,6 +10,8 @@ auto p2 = fs::u8path(s, s); // { dg-warning "deprecated" }
 
 #if __cpp_lib_char8_t
 const char8_t* u = u8"";
+#else
+const char* u = u8"";
+#endif
 auto p3 = fs::u8path(u); // { dg-warning "deprecated" }
 auto p4 = fs::u8path(u, u); // { dg-warning "deprecated" }
-#endif
index 12f47ae813314ed921c443aba44e2034bdf9de49..8d9501f42ef4bf5c9e9a06ad2a1fb3f6b0261929 100644 (file)
@@ -9,7 +9,7 @@ namespace std
 
   template<class charT> struct char_traits;
   template<> struct char_traits<char>;
-#if __cplusplus >= 202002L
+#if __cplusplus >= 202002L && defined __cpp_char8_t
   template<> struct char_traits<char8_t>;
 #endif
 #if __cplusplus >= 201103L
index 355269118a628323427956fa81df49f6501ccf47..b3d2f928ad53ed61390b4242d51e9b288c4e2155 100644 (file)
@@ -59,7 +59,9 @@ main ()
   check<unsigned long long>();
 
   check<wchar_t>();
+#if __cpp_char8_t
   check<char8_t>();
+#endif
   check<char16_t>();
   check<char32_t>();
 
index 0da206a5b0072bc5de6c38403c4d9d99635c49ce..c3aebb2c5d997686946ab3ee4457671da0c93552 100644 (file)
@@ -47,9 +47,7 @@ void test01()
   using atomic_llong;          // { dg-error "expected nested-name-specifier" }
   using atomic_ullong;         // { dg-error "expected nested-name-specifier" }
   using atomic_wchar_t;                // { dg-error "expected nested-name-specifier" }
-#ifdef _GLIBCXX_USE_CHAR8_T
   using atomic_char8_t;                // { dg-error "expected nested-name-specifier" }
-#endif
   using atomic_char16_t;       // { dg-error "expected nested-name-specifier" }
   using atomic_char32_t;       // { dg-error "expected nested-name-specifier" }