From: Jonathan Wakely Date: Tue, 19 Feb 2019 02:55:12 +0000 (+0000) Subject: Adjust C++11/C++14 tests to work with -fchar8_t X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=102a4fe17e1b54c2de0bb7b116198f6eb1d14e2f;p=gcc.git Adjust C++11/C++14 tests to work with -fchar8_t * testsuite/21_strings/basic_string/literals/types.cc [_GLIBCXX_USE_CHAR8_T]: Adjust expected string type for u8 literal. * testsuite/21_strings/basic_string/literals/values.cc [_GLIBCXX_USE_CHAR8_T]: Likewise. * testsuite/22_locale/codecvt/char16_t.cc: Adjust for u8 literals potentially having different type. * testsuite/22_locale/codecvt/char32_t.cc: Likewise. * testsuite/22_locale/codecvt/codecvt_utf8/79980.cc: Cast u8 literal to char. * testsuite/22_locale/codecvt/codecvt_utf8/wchar_t/1.cc: Likewise. * testsuite/22_locale/codecvt/utf8.cc: Likewise. * testsuite/22_locale/conversions/string/2.cc: Remove u8 prefix from string literals only using basic character set. * testsuite/22_locale/conversions/string/3.cc: Likewise. Cast other u8 literals to char. * testsuite/29_atomics/headers/atomic/macros.cc [_GLIBCXX_USE_CHAR8_T]: Test ATOMIC_CHAR8_T_LOCK_FREE. Add missing #error to ATOMIC_CHAR16_T_LOCK_FREE test. * testsuite/29_atomics/headers/atomic/types_std_c++0x.cc [_GLIBCXX_USE_CHAR8_T]: Check for std::atomic_char8_t. * testsuite/experimental/string_view/literals/types.cc [_GLIBCXX_USE_CHAR8_T]: Adjust expected string_view type for u8 literal. * testsuite/experimental/string_view/literals/values.cc [_GLIBCXX_USE_CHAR8_T]: Likewise. From-SVN: r269006 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index fd9ad8fc389..99108d9dd56 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,31 @@ +2019-02-19 Jonathan Wakely + + * testsuite/21_strings/basic_string/literals/types.cc + [_GLIBCXX_USE_CHAR8_T]: Adjust expected string type for u8 literal. + * testsuite/21_strings/basic_string/literals/values.cc + [_GLIBCXX_USE_CHAR8_T]: Likewise. + * testsuite/22_locale/codecvt/char16_t.cc: Adjust for u8 literals + potentially having different type. + * testsuite/22_locale/codecvt/char32_t.cc: Likewise. + * testsuite/22_locale/codecvt/codecvt_utf8/79980.cc: Cast u8 literal + to char. + * testsuite/22_locale/codecvt/codecvt_utf8/wchar_t/1.cc: Likewise. + * testsuite/22_locale/codecvt/utf8.cc: Likewise. + * testsuite/22_locale/conversions/string/2.cc: Remove u8 prefix from + string literals only using basic character set. + * testsuite/22_locale/conversions/string/3.cc: Likewise. Cast other + u8 literals to char. + * testsuite/29_atomics/headers/atomic/macros.cc [_GLIBCXX_USE_CHAR8_T]: + Test ATOMIC_CHAR8_T_LOCK_FREE. + Add missing #error to ATOMIC_CHAR16_T_LOCK_FREE test. + * testsuite/29_atomics/headers/atomic/types_std_c++0x.cc + [_GLIBCXX_USE_CHAR8_T]: Check for std::atomic_char8_t. + * testsuite/experimental/string_view/literals/types.cc + [_GLIBCXX_USE_CHAR8_T]: Adjust expected string_view type for u8 + literal. + * testsuite/experimental/string_view/literals/values.cc + [_GLIBCXX_USE_CHAR8_T]: Likewise. + 2019-02-19 Tom Honermann * testsuite/18_support/numeric_limits/char8_t.cc: New test cloned diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/literals/types.cc b/libstdc++-v3/testsuite/21_strings/basic_string/literals/types.cc index aa103ba4b32..1dbd70a771b 100644 --- a/libstdc++-v3/testsuite/21_strings/basic_string/literals/types.cc +++ b/libstdc++-v3/testsuite/21_strings/basic_string/literals/types.cc @@ -20,6 +20,12 @@ #include #include +#ifdef _GLIBCXX_USE_CHAR8_T +using std::u8string; +#else +using u8string = std::string; +#endif + void test01() { @@ -28,7 +34,7 @@ test01() static_assert(std::is_same::value, "\"Hello\"s is std::string"); - static_assert(std::is_same::value, + static_assert(std::is_same::value, "u8\"Hello\"s is std::string"); #ifdef _GLIBCXX_USE_WCHAR_T diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/literals/values.cc b/libstdc++-v3/testsuite/21_strings/basic_string/literals/values.cc index 8b0741d175f..f0d48c85c7d 100644 --- a/libstdc++-v3/testsuite/21_strings/basic_string/literals/values.cc +++ b/libstdc++-v3/testsuite/21_strings/basic_string/literals/values.cc @@ -20,6 +20,12 @@ #include #include +#ifdef _GLIBCXX_USE_CHAR8_T +using std::u8string; +#else +using u8string = std::string; +#endif + void test01() { @@ -29,7 +35,7 @@ test01() #ifdef _GLIBCXX_USE_WCHAR_T std::wstring wplanet = L"Venus"s; #endif - std::string u8planet = u8"Mars"s; + u8string u8planet = u8"Mars"s; std::u16string u16planet = u"Jupiter"s; std::u32string u32planet = U"Saturn"s; @@ -37,7 +43,7 @@ test01() #ifdef _GLIBCXX_USE_WCHAR_T VERIFY( wplanet == std::wstring(L"Venus") ); #endif - VERIFY( u8planet == std::string(u8"Mars") ); + VERIFY( u8planet == u8string(u8"Mars") ); VERIFY( u16planet == std::u16string(u"Jupiter") ); VERIFY( u32planet == std::u32string(U"Saturn") ); } diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/literals/types.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/literals/types.cc index 1fe9c5355c5..342789b779e 100644 --- a/libstdc++-v3/testsuite/21_strings/basic_string_view/literals/types.cc +++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/literals/types.cc @@ -21,6 +21,12 @@ #include #include +#ifdef _GLIBCXX_USE_CHAR8_T +using std::u8string_view; +#else +using u8string_view = std::string_view; +#endif + void test01() { @@ -29,7 +35,7 @@ test01() static_assert(std::is_same::value, "\"Hello\"s is std::string_view"); - static_assert(std::is_same::value, + static_assert(std::is_same::value, "u8\"Hello\"s is std::string_view"); #ifdef _GLIBCXX_USE_WCHAR_T diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/literals/values.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/literals/values.cc index ff78596605c..88434337b9a 100644 --- a/libstdc++-v3/testsuite/21_strings/basic_string_view/literals/values.cc +++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/literals/values.cc @@ -20,6 +20,12 @@ #include #include +#ifdef _GLIBCXX_USE_CHAR8_T +using std::u8string_view; +#else +using u8string_view = std::string_view; +#endif + void test01() { @@ -29,7 +35,7 @@ test01() #ifdef _GLIBCXX_USE_WCHAR_T std::wstring_view wplanet = L"Venus"sv; #endif - std::string_view u8planet = u8"Mars"sv; + u8string_view u8planet = u8"Mars"sv; std::u16string_view u16planet = u"Jupiter"sv; std::u32string_view u32planet = U"Saturn"sv; @@ -37,7 +43,7 @@ test01() #ifdef _GLIBCXX_USE_WCHAR_T VERIFY( wplanet == std::wstring_view(L"Venus") ); #endif - VERIFY( u8planet == std::string_view(u8"Mars") ); + VERIFY( u8planet == u8string_view(u8"Mars") ); VERIFY( u16planet == std::u16string_view(u"Jupiter") ); VERIFY( u32planet == std::u32string_view(U"Saturn") ); } @@ -51,7 +57,7 @@ test02() #ifdef _GLIBCXX_USE_WCHAR_T std::wstring_view wplanet_cratered = L"Venus\0cratered"sv; #endif - std::string_view u8planet_cratered = u8"Mars\0cratered"sv; + u8string_view u8planet_cratered = u8"Mars\0cratered"sv; std::u16string_view u16planet_cratered = u"Jupiter\0cratered"sv; std::u32string_view u32planet_cratered = U"Saturn\0cratered"sv; @@ -59,7 +65,7 @@ test02() #ifdef _GLIBCXX_USE_WCHAR_T VERIFY( wplanet_cratered == std::wstring_view(L"Venus\0cratered", 14) ); #endif - VERIFY( u8planet_cratered == std::string_view(u8"Mars\0cratered", 13) ); + VERIFY( u8planet_cratered == u8string_view(u8"Mars\0cratered", 13) ); VERIFY( u16planet_cratered == std::u16string_view(u"Jupiter\0cratered", 16) ); VERIFY( u32planet_cratered == std::u32string_view(U"Saturn\0cratered", 15) ); } diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/char16_t.cc b/libstdc++-v3/testsuite/22_locale/codecvt/char16_t.cc index 767a9be00ed..d1f0e805268 100644 --- a/libstdc++-v3/testsuite/22_locale/codecvt/char16_t.cc +++ b/libstdc++-v3/testsuite/22_locale/codecvt/char16_t.cc @@ -36,11 +36,15 @@ test01() VERIFY(cvt->max_length() == 4); VERIFY(cvt->encoding() == 0); - const char u8dat[] = u8"H\U000000E4ll\U000000F6 \U0001F63F \U000056FD " +#ifndef _GLIBCXX_USE_CHAR8_T + using char8_t = char; +#endif + const char8_t u8dat_[] = u8"H\U000000E4ll\U000000F6 \U0001F63F \U000056FD " u8"\U0000222B f(\U000003BA) exp(-2\U000003C0\U000003C9) d\U000003BA " u8"\U0001F6BF \U0001F6BF \U0001F648 \U00000413\U00000435\U0000043E" u8"\U00000433\U00000440\U00000430\U00000444\U00000438\U0000044F \U0000FB05"; - const char* const u8dat_end = std::end(u8dat); + const char* const u8dat = (const char*)u8dat_; + const char* const u8dat_end = (const char*)std::end(u8dat_); const char16_t u16dat[] = u"H\U000000E4ll\U000000F6 \U0001F63F \U000056FD " u"\U0000222B f(\U000003BA) exp(-2\U000003C0\U000003C9) d\U000003BA " @@ -83,7 +87,7 @@ test01() VERIFY(res == codecvt_base::ok); VERIFY(from_next == u16dat_end); - VERIFY(std::memcmp((void*)buffer, (void*)u8dat, sizeof(u8dat)) == 0); + VERIFY(std::memcmp((void*)buffer, (void*)u8dat_, sizeof(u8dat_)) == 0); delete[] buffer; } diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/char32_t.cc b/libstdc++-v3/testsuite/22_locale/codecvt/char32_t.cc index fc6c93691b2..8df3b2d7682 100644 --- a/libstdc++-v3/testsuite/22_locale/codecvt/char32_t.cc +++ b/libstdc++-v3/testsuite/22_locale/codecvt/char32_t.cc @@ -38,11 +38,15 @@ test01() VERIFY(cvt->max_length() == 4); VERIFY(cvt->encoding() == 0); - const char u8dat[] = u8"H\U000000E4ll\U000000F6 \U0001F63F \U000056FD " +#ifndef _GLIBCXX_USE_CHAR8_T + using char8_t = char; +#endif + const char8_t u8dat_[] = u8"H\U000000E4ll\U000000F6 \U0001F63F \U000056FD " u8"\U0000222B f(\U000003BA) exp(-2\U000003C0\U000003C9) d\U000003BA " u8"\U0001F6BF \U0001F6BF \U0001F648 \U00000413\U00000435\U0000043E" u8"\U00000433\U00000440\U00000430\U00000444\U00000438\U0000044F \U0000FB05"; - const char* const u8dat_end = std::end(u8dat); + const char* const u8dat = (const char*)u8dat_; + const char* const u8dat_end = (const char*)std::end(u8dat_); const char32_t u32dat[] = U"H\U000000E4ll\U000000F6 \U0001F63F \U000056FD " U"\U0000222B f(\U000003BA) exp(-2\U000003C0\U000003C9) d\U000003BA " @@ -85,7 +89,7 @@ test01() VERIFY(res == codecvt_base::ok); VERIFY(from_next == u32dat_end); - VERIFY(std::memcmp((void*)buffer, (void*)u8dat, sizeof(u8dat)) == 0); + VERIFY(std::memcmp((void*)buffer, (void*)u8dat_, sizeof(u8dat_)) == 0); delete[] buffer; } diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/codecvt_utf8/79980.cc b/libstdc++-v3/testsuite/22_locale/codecvt/codecvt_utf8/79980.cc index 331d57f9505..6d7eafb01f1 100644 --- a/libstdc++-v3/testsuite/22_locale/codecvt/codecvt_utf8/79980.cc +++ b/libstdc++-v3/testsuite/22_locale/codecvt/codecvt_utf8/79980.cc @@ -28,7 +28,7 @@ using std::codecvt_utf8; void test01() { - std::string src = u8"1234\U00001111\U0001ffff"; + std::string src = (const char*)u8"1234\U00001111\U0001ffff"; wstring_convert, char16_t> c("bad", u"BAD"); // utf-8 to ucs2 conversion should fail on character outside BMP @@ -51,7 +51,7 @@ test01() void test02() { - std::string src = u8"1234\U00001111\U0001ffff"; + std::string src = (const char*)u8"1234\U00001111\U0001ffff"; wstring_convert, char16_t> c("bad", u"BAD"); // utf-8 to ucs2 conversion should fail on character above Maxcode=0x1000 @@ -63,7 +63,7 @@ test02() void test03() { - std::string src = u8"1234\U00001111\U0001ffff"; + std::string src = (const char*)u8"1234\U00001111\U0001ffff"; wstring_convert, char32_t> c("bad", U"BAD"); // utf-8 to ucs4 conversion should fail on character above Maxcode=0x10000 @@ -75,7 +75,7 @@ test03() void test04() { - std::string src = u8"1234\U00001111\U0001ffff"; + std::string src = (const char*)u8"1234\U00001111\U0001ffff"; wstring_convert, char32_t> c("bad", U"BAD"); // utf-8 to ucs4 conversion should fail on character above Maxcode=0x1000 diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/codecvt_utf8/wchar_t/1.cc b/libstdc++-v3/testsuite/22_locale/codecvt/codecvt_utf8/wchar_t/1.cc index aa2704831ba..694845fc4e9 100644 --- a/libstdc++-v3/testsuite/22_locale/codecvt/codecvt_utf8/wchar_t/1.cc +++ b/libstdc++-v3/testsuite/22_locale/codecvt/codecvt_utf8/wchar_t/1.cc @@ -24,7 +24,7 @@ void test01() { - const char out[] = u8"\u00A33.50"; + const auto out = (const char*)u8"\u00A33.50"; wchar_t in[8] = {}; std::codecvt_utf8 cvt; std::mbstate_t st; diff --git a/libstdc++-v3/testsuite/22_locale/codecvt/utf8.cc b/libstdc++-v3/testsuite/22_locale/codecvt/utf8.cc index 602fe63e738..82ee8ad211a 100644 --- a/libstdc++-v3/testsuite/22_locale/codecvt/utf8.cc +++ b/libstdc++-v3/testsuite/22_locale/codecvt/utf8.cc @@ -22,7 +22,7 @@ #include #include -const char expected[] = u8"£¥€"; +const auto expected = (const char*)u8"£¥€"; const std::size_t expected_len = std::char_traits::length(expected); template diff --git a/libstdc++-v3/testsuite/22_locale/conversions/string/2.cc b/libstdc++-v3/testsuite/22_locale/conversions/string/2.cc index e83cf98e4c7..2e97b4f3ab0 100644 --- a/libstdc++-v3/testsuite/22_locale/conversions/string/2.cc +++ b/libstdc++-v3/testsuite/22_locale/conversions/string/2.cc @@ -40,14 +40,14 @@ void test01() typedef str_conv sc; const sc::byte_string berr = "invalid wide string"; - const sc::wide_string werr = u8"invalid byte string"; + const sc::wide_string werr = "invalid byte string"; sc c(berr, werr); string input = "Stop"; input += char(0xFF); string woutput = c.from_bytes(input); VERIFY( input == woutput ); // noconv case doesn't detect invalid input - string winput = u8"Stop"; + string winput = "Stop"; winput += char(0xFF); string output = c.to_bytes(winput); VERIFY( winput == output ); // noconv case doesn't detect invalid input diff --git a/libstdc++-v3/testsuite/22_locale/conversions/string/3.cc b/libstdc++-v3/testsuite/22_locale/conversions/string/3.cc index 404e869e0ad..b66e94813b2 100644 --- a/libstdc++-v3/testsuite/22_locale/conversions/string/3.cc +++ b/libstdc++-v3/testsuite/22_locale/conversions/string/3.cc @@ -40,17 +40,17 @@ void test01() typedef str_conv wsc; wsc c; - string input = u8"\u00a3 shillings pence"; + string input = (const char*)u8"\u00a3 shillings pence"; string woutput = c.from_bytes(input.substr(0, 1)); auto partial_state = c.state(); auto partial_count = c.converted(); - auto woutput2 = c.from_bytes(u8"state reset on next conversion"); - VERIFY( woutput2 == u8"state reset on next conversion" ); + auto woutput2 = c.from_bytes("state reset on next conversion"); + VERIFY( woutput2 == "state reset on next conversion" ); wsc c2(new cvt, partial_state); woutput += c2.from_bytes(input.substr(partial_count)); - VERIFY( u8"\u00a3 shillings pence" == woutput ); + VERIFY( (const char*)u8"\u00a3 shillings pence" == woutput ); string roundtrip = c2.to_bytes(woutput); VERIFY( input == roundtrip ); @@ -61,12 +61,12 @@ void test02() typedef str_conv wsc; wsc c; - string input = u8"\u00a3 shillings pence"; + string input = (const char*)u8"\u00a3 shillings pence"; u16string woutput = c.from_bytes(input.substr(0, 1)); auto partial_state = c.state(); auto partial_count = c.converted(); - auto woutput2 = c.from_bytes(u8"state reset on next conversion"); + auto woutput2 = c.from_bytes("state reset on next conversion"); VERIFY( woutput2 == u"state reset on next conversion" ); wsc c2(new cvt, partial_state); @@ -82,12 +82,12 @@ void test03() typedef str_conv wsc; wsc c; - string input = u8"\u00a3 shillings pence"; + string input = (const char*)u8"\u00a3 shillings pence"; u32string woutput = c.from_bytes(input.substr(0, 1)); auto partial_state = c.state(); auto partial_count = c.converted(); - auto woutput2 = c.from_bytes(u8"state reset on next conversion"); + auto woutput2 = c.from_bytes("state reset on next conversion"); VERIFY( woutput2 == U"state reset on next conversion" ); wsc c2(new cvt, partial_state); diff --git a/libstdc++-v3/testsuite/29_atomics/headers/atomic/macros.cc b/libstdc++-v3/testsuite/29_atomics/headers/atomic/macros.cc index 144c8582a41..ac03f362411 100644 --- a/libstdc++-v3/testsuite/29_atomics/headers/atomic/macros.cc +++ b/libstdc++-v3/testsuite/29_atomics/headers/atomic/macros.cc @@ -31,9 +31,18 @@ # error "ATOMIC_CHAR_LOCK_FREE must be 1 or 2" #endif +#ifdef _GLIBCXX_USE_CHAR8_T +# ifndef ATOMIC_CHAR8_T_LOCK_FREE +# error "ATOMIC_CHAR8_T_LOCK_FREE must be a macro" +# elif ATOMIC_CHAR8_T_LOCK_FREE != 1 && ATOMIC_CHAR8_T_LOCK_FREE != 2 +# error "ATOMIC_CHAR8_T_LOCK_FREE must be 1 or 2" +# endif +#endif + #ifndef ATOMIC_CHAR16_T_LOCK_FREE # error "ATOMIC_CHAR16_T_LOCK_FREE must be a macro" #elif ATOMIC_CHAR16_T_LOCK_FREE != 1 && ATOMIC_CHAR16_T_LOCK_FREE != 2 +# error "ATOMIC_CHAR16_T_LOCK_FREE must be 1 or 2" #endif #ifndef ATOMIC_CHAR32_T_LOCK_FREE diff --git a/libstdc++-v3/testsuite/29_atomics/headers/atomic/types_std_c++0x.cc b/libstdc++-v3/testsuite/29_atomics/headers/atomic/types_std_c++0x.cc index c53bb24fa49..47084c4a33a 100644 --- a/libstdc++-v3/testsuite/29_atomics/headers/atomic/types_std_c++0x.cc +++ b/libstdc++-v3/testsuite/29_atomics/headers/atomic/types_std_c++0x.cc @@ -46,6 +46,9 @@ void test01() using std::atomic_llong; using std::atomic_ullong; using std::atomic_wchar_t; +#ifdef _GLIBCXX_USE_CHAR8_T + using std::atomic_char8_t; +#endif using std::atomic_char16_t; using std::atomic_char32_t; diff --git a/libstdc++-v3/testsuite/experimental/string_view/literals/types.cc b/libstdc++-v3/testsuite/experimental/string_view/literals/types.cc index 022c3fabe26..0998a05dcbd 100644 --- a/libstdc++-v3/testsuite/experimental/string_view/literals/types.cc +++ b/libstdc++-v3/testsuite/experimental/string_view/literals/types.cc @@ -20,6 +20,12 @@ #include #include +#ifdef _GLIBCXX_USE_CHAR8_T +using std::experimental::u8string_view; +#else +using u8string_view = std::experimental::string_view; +#endif + void test01() { @@ -28,7 +34,7 @@ test01() static_assert(std::is_same::value, "\"Hello\"s is std::string_view"); - static_assert(std::is_same::value, + static_assert(std::is_same::value, "u8\"Hello\"s is std::string_view"); #ifdef _GLIBCXX_USE_WCHAR_T diff --git a/libstdc++-v3/testsuite/experimental/string_view/literals/values.cc b/libstdc++-v3/testsuite/experimental/string_view/literals/values.cc index 3af91c25fcb..e18ee7edf6e 100644 --- a/libstdc++-v3/testsuite/experimental/string_view/literals/values.cc +++ b/libstdc++-v3/testsuite/experimental/string_view/literals/values.cc @@ -20,6 +20,12 @@ #include #include +#ifdef _GLIBCXX_USE_CHAR8_T +using std::experimental::u8string_view; +#else +using u8string_view = std::experimental::string_view; +#endif + void test01() { @@ -29,7 +35,7 @@ test01() #ifdef _GLIBCXX_USE_WCHAR_T std::experimental::wstring_view wplanet = L"Venus"sv; #endif - std::experimental::string_view u8planet = u8"Mars"sv; + u8string_view u8planet = u8"Mars"sv; std::experimental::u16string_view u16planet = u"Jupiter"sv; std::experimental::u32string_view u32planet = U"Saturn"sv; @@ -37,7 +43,7 @@ test01() #ifdef _GLIBCXX_USE_WCHAR_T VERIFY( wplanet == std::experimental::wstring_view(L"Venus") ); #endif - VERIFY( u8planet == std::experimental::string_view(u8"Mars") ); + VERIFY( u8planet == u8string_view(u8"Mars") ); VERIFY( u16planet == std::experimental::u16string_view(u"Jupiter") ); VERIFY( u32planet == std::experimental::u32string_view(U"Saturn") ); } @@ -51,7 +57,7 @@ test02() #ifdef _GLIBCXX_USE_WCHAR_T std::experimental::wstring_view wplanet_cratered = L"Venus\0cratered"sv; #endif - std::experimental::string_view u8planet_cratered = u8"Mars\0cratered"sv; + u8string_view u8planet_cratered = u8"Mars\0cratered"sv; std::experimental::u16string_view u16planet_cratered = u"Jupiter\0cratered"sv; std::experimental::u32string_view u32planet_cratered = U"Saturn\0cratered"sv; @@ -61,8 +67,7 @@ test02() VERIFY( wplanet_cratered == std::experimental::wstring_view(L"Venus\0cratered", 14) ); #endif - VERIFY( u8planet_cratered == - std::experimental::string_view(u8"Mars\0cratered", 13) ); + VERIFY( u8planet_cratered == u8string_view(u8"Mars\0cratered", 13) ); VERIFY( u16planet_cratered == std::experimental::u16string_view(u"Jupiter\0cratered", 16) ); VERIFY( u32planet_cratered ==