libstdc++: Fix some test failures with -fno-char8_t
libstdc++-v3/ChangeLog: * testsuite/20_util/duration/io.cc [!__cpp_lib_char8_t]: Define char8_t as a typedef for unsigned char. * testsuite/std/format/parse_ctx_neg.cc: Skip for -fno-char8_t.
This commit is contained in:
parent
36b9c5e6f3
commit
cb0988a659
2 changed files with 9 additions and 2 deletions
|
@ -5,6 +5,10 @@
|
|||
#include <sstream>
|
||||
#include <testsuite_hooks.h>
|
||||
|
||||
#ifndef __cpp_lib_char8_t
|
||||
using char8_t = unsigned char; // Prevent errors if -fno-char8_t is used.
|
||||
#endif
|
||||
|
||||
void
|
||||
test01()
|
||||
{
|
||||
|
@ -173,12 +177,14 @@ test_format()
|
|||
|
||||
#if __cplusplus > 202002L
|
||||
static_assert( ! std::formattable<std::chrono::duration<wchar_t>, char> );
|
||||
static_assert( ! std::formattable<std::chrono::duration<char8_t>, char> );
|
||||
static_assert( ! std::formattable<std::chrono::duration<char16_t>, char> );
|
||||
static_assert( ! std::formattable<std::chrono::duration<char32_t>, char> );
|
||||
static_assert( ! std::formattable<std::chrono::duration<char8_t>, wchar_t> );
|
||||
static_assert( ! std::formattable<std::chrono::duration<char16_t>, wchar_t> );
|
||||
static_assert( ! std::formattable<std::chrono::duration<char32_t>, wchar_t> );
|
||||
#ifdef __cpp_lib_char8_t
|
||||
static_assert( ! std::formattable<std::chrono::duration<char8_t>, char> );
|
||||
static_assert( ! std::formattable<std::chrono::duration<char8_t>, wchar_t> );
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
// { dg-do compile { target c++26 } }
|
||||
// { dg-skip-if "" { *-*-* } { "-fno-char8_t" } }
|
||||
|
||||
#include <format>
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue