From: Tom Honermann Date: Fri, 22 Feb 2019 01:16:08 +0000 (+0000) Subject: P0482R5 char8_t: Updates to existing standard library tests X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=59019b4223633066d86d46147bc2c01de8d9da22;p=gcc.git P0482R5 char8_t: Updates to existing standard library tests This patch augments existing tests to validate behavior for char8_t. In all cases, added test cases are cloned from existing tests for wchar_t or char16_t. A few tests required updates to line numbers for diagnostic messages. 2019-02-22 Tom Honermann * testsuite/18_support/byte/ops.cc: Validate std::to_integer, std::to_integer, and std::to_integer. * testsuite/18_support/numeric_limits/dr559.cc: Validate std::numeric_limits. * testsuite/18_support/numeric_limits/lowest.cc: Validate std::numeric_limits::lowest(). * testsuite/18_support/numeric_limits/max_digits10.cc: Validate std::numeric_limits::max_digits10. * testsuite/18_support/type_info/fundamental.cc: Validate typeinfo for char8_t. * testsuite/20_util/from_chars/1_c++20_neg.cc: New test, validating std::from_chars with char8_t. * testsuite/20_util/hash/requirements/explicit_instantiation.cc: Validate explicit instantiation of std::hash. * testsuite/20_util/is_integral/value.cc: Validate std::is_integral. * testsuite/20_util/make_signed/requirements/typedefs-4.cc: Validate std::make_signed. * testsuite/21_strings/basic_string/cons/char/deduction.cc: Validate u8string construction from char8_t sources. * testsuite/21_strings/basic_string/types/pmr_typedefs.cc: Validate std::pmr::u8string. * testsuite/21_strings/basic_string_view/operations/compare/ char/70483.cc: Validate substr operations on u8string_view. * testsuite/21_strings/basic_string_view/typedefs.cc: Validate that the u8string_view typedef is defined. * testsuite/21_strings/char_traits/requirements/ constexpr_functions.cc: Validate char_traits constexpr member functions. * testsuite/21_strings/char_traits/requirements/ constexpr_functions_c++17.cc: Validate char_traits C++17 constexpr member functions. * testsuite/21_strings/headers/string/types_std_c++0x.cc: Validate that the u8string typedef is defined. * testsuite/22_locale/locale/cons/unicode.cc: Validate the presence of the std::codecvt and std::codecvt facets. * testsuite/29_atomics/atomic/cons/assign_neg.cc: Update line numbers. * testsuite/29_atomics/atomic/cons/copy_neg.cc: Likewise. * testsuite/29_atomics/atomic_integral/cons/assign_neg.cc: Likewise. * testsuite/29_atomics/atomic_integral/cons/copy_neg.cc: Likewise. * testsuite/29_atomics/atomic_integral/is_always_lock_free.cc: Validate std::atomic::is_always_lock_free * testsuite/29_atomics/atomic_integral/operators/bitwise_neg.cc: Update line numbers. * testsuite/29_atomics/atomic_integral/operators/decrement_neg.cc: Likewise. * testsuite/29_atomics/atomic_integral/operators/increment_neg.cc: Likewise. * testsuite/experimental/polymorphic_allocator/pmr_typedefs_string.cc: Validate std::experimental::pmr::u8string. * testsuite/experimental/string_view/typedefs.cc: Validate that the u8string_view typedef is defined. * testsuite/util/testsuite_common_types.h: Add char8_t, char16_t and char32_t to the typelists. From-SVN: r269089 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 904da1ba4c9..b94e30f12a8 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,64 @@ +2019-02-22 Tom Honermann + + * testsuite/18_support/byte/ops.cc: Validate + std::to_integer, std::to_integer, and + std::to_integer. + * testsuite/18_support/numeric_limits/dr559.cc: Validate + std::numeric_limits. + * testsuite/18_support/numeric_limits/lowest.cc: Validate + std::numeric_limits::lowest(). + * testsuite/18_support/numeric_limits/max_digits10.cc: Validate + std::numeric_limits::max_digits10. + * testsuite/18_support/type_info/fundamental.cc: Validate + typeinfo for char8_t. + * testsuite/20_util/from_chars/1_c++20_neg.cc: New test, validating + std::from_chars with char8_t. + * testsuite/20_util/hash/requirements/explicit_instantiation.cc: + Validate explicit instantiation of std::hash. + * testsuite/20_util/is_integral/value.cc: Validate + std::is_integral. + * testsuite/20_util/make_signed/requirements/typedefs-4.cc: + Validate std::make_signed. + * testsuite/21_strings/basic_string/cons/char/deduction.cc: + Validate u8string construction from char8_t sources. + * testsuite/21_strings/basic_string/types/pmr_typedefs.cc: Validate + std::pmr::u8string. + * testsuite/21_strings/basic_string_view/operations/compare/ + char/70483.cc: Validate substr operations on u8string_view. + * testsuite/21_strings/basic_string_view/typedefs.cc: Validate that + the u8string_view typedef is defined. + * testsuite/21_strings/char_traits/requirements/ + constexpr_functions.cc: Validate char_traits constexpr + member functions. + * testsuite/21_strings/char_traits/requirements/ + constexpr_functions_c++17.cc: Validate char_traits C++17 + constexpr member functions. + * testsuite/21_strings/headers/string/types_std_c++0x.cc: Validate + that the u8string typedef is defined. + * testsuite/22_locale/locale/cons/unicode.cc: Validate the presence + of the std::codecvt and + std::codecvt facets. + * testsuite/29_atomics/atomic/cons/assign_neg.cc: Update line + numbers. + * testsuite/29_atomics/atomic/cons/copy_neg.cc: Likewise. + * testsuite/29_atomics/atomic_integral/cons/assign_neg.cc: + Likewise. + * testsuite/29_atomics/atomic_integral/cons/copy_neg.cc: Likewise. + * testsuite/29_atomics/atomic_integral/is_always_lock_free.cc: + Validate std::atomic::is_always_lock_free + * testsuite/29_atomics/atomic_integral/operators/bitwise_neg.cc: + Update line numbers. + * testsuite/29_atomics/atomic_integral/operators/decrement_neg.cc: + Likewise. + * testsuite/29_atomics/atomic_integral/operators/increment_neg.cc: + Likewise. + * testsuite/experimental/polymorphic_allocator/pmr_typedefs_string.cc: + Validate std::experimental::pmr::u8string. + * testsuite/experimental/string_view/typedefs.cc: Validate that the + u8string_view typedef is defined. + * testsuite/util/testsuite_common_types.h: Add char8_t, char16_t and + char32_t to the typelists. + 2019-02-22 Tom Honermann * include/ext/typelist.h: Constrain a partial specialization of diff --git a/libstdc++-v3/testsuite/18_support/byte/ops.cc b/libstdc++-v3/testsuite/18_support/byte/ops.cc index 37a75fa2a32..6b01c1c38f0 100644 --- a/libstdc++-v3/testsuite/18_support/byte/ops.cc +++ b/libstdc++-v3/testsuite/18_support/byte/ops.cc @@ -218,7 +218,15 @@ constexpr bool test_to_integer(unsigned char c) static_assert( test_to_integer(0) ); static_assert( test_to_integer(255) ); +static_assert( test_to_integer(0) ); static_assert( test_to_integer(255) ); static_assert( test_to_integer(0) ); static_assert( test_to_integer(255) ); - +#ifdef _GLIBCXX_USE_CHAR8_T +static_assert( test_to_integer(0) ); +static_assert( test_to_integer(255) ); +#endif +static_assert( test_to_integer(0) ); +static_assert( test_to_integer(255) ); +static_assert( test_to_integer(0) ); +static_assert( test_to_integer(255) ); diff --git a/libstdc++-v3/testsuite/18_support/numeric_limits/dr559.cc b/libstdc++-v3/testsuite/18_support/numeric_limits/dr559.cc index bf6dac73b0b..504866b636a 100644 --- a/libstdc++-v3/testsuite/18_support/numeric_limits/dr559.cc +++ b/libstdc++-v3/testsuite/18_support/numeric_limits/dr559.cc @@ -84,6 +84,9 @@ int main() do_test(); do_test(); do_test(); +#ifdef _GLIBCXX_USE_CHAR8_T + do_test(); +#endif do_test(); do_test(); do_test(); diff --git a/libstdc++-v3/testsuite/18_support/numeric_limits/lowest.cc b/libstdc++-v3/testsuite/18_support/numeric_limits/lowest.cc index 85466c5b538..82d9a0f9bf0 100644 --- a/libstdc++-v3/testsuite/18_support/numeric_limits/lowest.cc +++ b/libstdc++-v3/testsuite/18_support/numeric_limits/lowest.cc @@ -54,6 +54,9 @@ void test01() do_test(); #ifdef _GLIBCXX_USE_WCHAR_T do_test(); +#endif +#ifdef _GLIBCXX_USE_CHAR8_T + do_test(); #endif do_test(); do_test(); diff --git a/libstdc++-v3/testsuite/18_support/numeric_limits/max_digits10.cc b/libstdc++-v3/testsuite/18_support/numeric_limits/max_digits10.cc index c0c3ab8aac8..c5475c508fd 100644 --- a/libstdc++-v3/testsuite/18_support/numeric_limits/max_digits10.cc +++ b/libstdc++-v3/testsuite/18_support/numeric_limits/max_digits10.cc @@ -42,6 +42,9 @@ test01() VERIFY( std::numeric_limits::max_digits10 == 0 ); VERIFY( std::numeric_limits::max_digits10 == 0 ); VERIFY( std::numeric_limits::max_digits10 == 0 ); +#ifdef _GLIBCXX_USE_CHAR8_T + VERIFY( std::numeric_limits::max_digits10 == 0 ); +#endif VERIFY( std::numeric_limits::max_digits10 == 0 ); VERIFY( std::numeric_limits::max_digits10 == 0 ); diff --git a/libstdc++-v3/testsuite/18_support/type_info/fundamental.cc b/libstdc++-v3/testsuite/18_support/type_info/fundamental.cc index 812c0103c68..717ebd6e149 100644 --- a/libstdc++-v3/testsuite/18_support/type_info/fundamental.cc +++ b/libstdc++-v3/testsuite/18_support/type_info/fundamental.cc @@ -50,6 +50,9 @@ int main() gen_type_info(); gen_type_info(); gen_type_info(); +#ifdef _GLIBCXX_USE_CHAR8_T + gen_type_info(); +#endif gen_type_info(); gen_type_info(); diff --git a/libstdc++-v3/testsuite/20_util/from_chars/1_c++20_neg.cc b/libstdc++-v3/testsuite/20_util/from_chars/1_c++20_neg.cc new file mode 100644 index 00000000000..83d297676bf --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/from_chars/1_c++20_neg.cc @@ -0,0 +1,38 @@ +// Copyright (C) 2017-2019 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +// { dg-options "-std=gnu++2a" } +// { dg-do compile { target c++2a } } + +#include + +void +test01(const char* first, const char* last) +{ + wchar_t wc; + std::from_chars(first, last, wc); // { dg-error "no matching" } + std::from_chars(first, last, wc, 10); // { dg-error "no matching" } + char8_t c8; + std::from_chars(first, last, c8); // { dg-error "no matching" } + std::from_chars(first, last, c8, 10); // { dg-error "no matching" } + char16_t c16; + std::from_chars(first, last, c16); // { dg-error "no matching" } + std::from_chars(first, last, c16, 10); // { dg-error "no matching" } + char32_t c32; + std::from_chars(first, last, c32); // { dg-error "no matching" } + std::from_chars(first, last, c32, 10); // { dg-error "no matching" } +} diff --git a/libstdc++-v3/testsuite/20_util/hash/requirements/explicit_instantiation.cc b/libstdc++-v3/testsuite/20_util/hash/requirements/explicit_instantiation.cc index f143b4d910e..ff390fb5a34 100644 --- a/libstdc++-v3/testsuite/20_util/hash/requirements/explicit_instantiation.cc +++ b/libstdc++-v3/testsuite/20_util/hash/requirements/explicit_instantiation.cc @@ -26,6 +26,9 @@ template class std::hash; template class std::hash; template class std::hash; template class std::hash; +#ifdef _GLIBCXX_USE_CHAR8_T +template class std::hash; +#endif template class std::hash; template class std::hash; template class std::hash; diff --git a/libstdc++-v3/testsuite/20_util/is_integral/value.cc b/libstdc++-v3/testsuite/20_util/is_integral/value.cc index 1e3c2e87f3a..1c3c412b94e 100644 --- a/libstdc++-v3/testsuite/20_util/is_integral/value.cc +++ b/libstdc++-v3/testsuite/20_util/is_integral/value.cc @@ -34,6 +34,9 @@ void test01() static_assert(test_category(true), ""); #ifdef _GLIBCXX_USE_WCHAR_T static_assert(test_category(true), ""); +#endif +#ifdef _GLIBCXX_USE_CHAR8_T + static_assert(test_category(true), ""); #endif static_assert(test_category(true), ""); static_assert(test_category(true), ""); diff --git a/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-4.cc b/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-4.cc index 41744661454..27eb1012125 100644 --- a/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-4.cc +++ b/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-4.cc @@ -27,5 +27,8 @@ using wchar_signed = make_signed::type; using wchar_unsigned = make_unsigned::type; static_assert( !is_same::value, "wchar_t" ); #endif +#ifdef _GLIBCXX_USE_CHAR8_T +static_assert( is_signed::type>::value, "char8_t"); +#endif static_assert( is_signed::type>::value, "char16_t"); static_assert( is_signed::type>::value, "char32_t"); diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/cons/char/deduction.cc b/libstdc++-v3/testsuite/21_strings/basic_string/cons/char/deduction.cc index a6ffc41309e..6bb2554f07d 100644 --- a/libstdc++-v3/testsuite/21_strings/basic_string/cons/char/deduction.cc +++ b/libstdc++-v3/testsuite/21_strings/basic_string/cons/char/deduction.cc @@ -122,6 +122,27 @@ test04() void test05() +{ +#ifdef _GLIBCXX_USE_CHAR8_T + char8_t a[1] = {}; + input_iterator_seq seq(a); + + std::basic_string s1(seq.begin(), seq.end()); + check_type(s1); + + std::basic_string s2(seq.begin(), seq.end(), std::allocator()); + check_type(s2); + + std::basic_string s3((char8_t)1, u8'a'); + check_type(s3); + + std::basic_string s4((char8_t)1, u8'a', std::allocator()); + check_type(s4); +#endif +} + +void +test06() { // LWG 3075 basic_string needs deduction guides from basic_string_view std::string_view sv{"A View to a Kill"}; @@ -141,7 +162,7 @@ test05() } void -test06() +test07() { // LWG 3076 basic_string CTAD ambiguity using namespace std; diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/types/pmr_typedefs.cc b/libstdc++-v3/testsuite/21_strings/basic_string/types/pmr_typedefs.cc index 8565170d26e..4b443570ccd 100644 --- a/libstdc++-v3/testsuite/21_strings/basic_string/types/pmr_typedefs.cc +++ b/libstdc++-v3/testsuite/21_strings/basic_string/types/pmr_typedefs.cc @@ -33,6 +33,11 @@ static_assert(std::is_same_v, static_assert(std::is_same_v, std::pmr::polymorphic_allocator>>); +#ifdef _GLIBCXX_USE_CHAR8_T +static_assert(std::is_same_v, + std::pmr::polymorphic_allocator>>); +#endif static_assert(std::is_same_v, std::pmr::polymorphic_allocator>>); diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/compare/char/70483.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/compare/char/70483.cc index 9315d3b6595..29facb1eea7 100644 --- a/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/compare/char/70483.cc +++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/operations/compare/char/70483.cc @@ -58,6 +58,25 @@ string_view get() static_assert( get() == get() ); +#ifdef _GLIBCXX_USE_CHAR8_T +using std::u8string_view; +#else +using u8string_view = std::basic_string_view; +#endif + +constexpr +u8string_view get8() +{ + u8string_view res = u8"x::"; + u8string_view start_pattern = u8"x"; + res = res.substr(res.find(start_pattern) + start_pattern.size()); + res = res.substr(0, res.find_first_of(u8";]")); + res = res.substr(res.rfind(u8"::")); + return res; +} + +static_assert( get8() == get8() ); + using std::u16string_view; constexpr diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/typedefs.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/typedefs.cc index 277d7ce8bcf..82bbe84f909 100644 --- a/libstdc++-v3/testsuite/21_strings/basic_string_view/typedefs.cc +++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/typedefs.cc @@ -25,12 +25,15 @@ template using check2_t = std::string_view; +#ifdef _GLIBCXX_USE_CHAR8_T +using check3_t = std::u8string_view; +#endif + #ifdef _GLIBCXX_USE_C99_STDINT_TR1 -using check3_t = std::u16string_view; -using check4_t = std::u32string_view; +using check4_t = std::u16string_view; +using check5_t = std::u32string_view; #endif #ifdef _GLIBCXX_USE_WCHAR_T -using check5_t = std::wstring_view; +using check6_t = std::wstring_view; #endif - diff --git a/libstdc++-v3/testsuite/21_strings/char_traits/requirements/constexpr_functions.cc b/libstdc++-v3/testsuite/21_strings/char_traits/requirements/constexpr_functions.cc index 239aa48fcf7..93815ff6979 100644 --- a/libstdc++-v3/testsuite/21_strings/char_traits/requirements/constexpr_functions.cc +++ b/libstdc++-v3/testsuite/21_strings/char_traits/requirements/constexpr_functions.cc @@ -66,6 +66,9 @@ int main() test.operator()>(); #ifdef _GLIBCXX_USE_WCHAR_T test.operator()>(); +#endif +#ifdef _GLIBCXX_USE_CHAR8_T + test.operator()>(); #endif test.operator()>(); test.operator()>(); diff --git a/libstdc++-v3/testsuite/21_strings/char_traits/requirements/constexpr_functions_c++17.cc b/libstdc++-v3/testsuite/21_strings/char_traits/requirements/constexpr_functions_c++17.cc index db368ecb60a..92c301b1900 100644 --- a/libstdc++-v3/testsuite/21_strings/char_traits/requirements/constexpr_functions_c++17.cc +++ b/libstdc++-v3/testsuite/21_strings/char_traits/requirements/constexpr_functions_c++17.cc @@ -89,6 +89,12 @@ static_assert( test_compare>() ); static_assert( test_length>() ); static_assert( test_find>() ); #endif +#ifdef _GLIBCXX_USE_CHAR8_T +static_assert( test_assign>() ); +static_assert( test_compare>() ); +static_assert( test_length>() ); +static_assert( test_find>() ); +#endif static_assert( test_assign>() ); static_assert( test_compare>() ); static_assert( test_length>() ); diff --git a/libstdc++-v3/testsuite/21_strings/headers/string/types_std_c++0x.cc b/libstdc++-v3/testsuite/21_strings/headers/string/types_std_c++0x.cc index ab4440541e0..6e5cf8c78e6 100644 --- a/libstdc++-v3/testsuite/21_strings/headers/string/types_std_c++0x.cc +++ b/libstdc++-v3/testsuite/21_strings/headers/string/types_std_c++0x.cc @@ -21,6 +21,9 @@ namespace gnu { +#ifdef _GLIBCXX_USE_CHAR8_T + typedef std::u8string t2; +#endif typedef std::u16string t3; typedef std::u32string t4; } diff --git a/libstdc++-v3/testsuite/22_locale/locale/cons/unicode.cc b/libstdc++-v3/testsuite/22_locale/locale/cons/unicode.cc index fb8e12113f5..21b75341237 100644 --- a/libstdc++-v3/testsuite/22_locale/locale/cons/unicode.cc +++ b/libstdc++-v3/testsuite/22_locale/locale/cons/unicode.cc @@ -36,6 +36,10 @@ typedef std::codecvt w_codecvt; #ifdef _GLIBCXX_USE_C99_STDINT_TR1 typedef std::codecvt u16_codecvt; typedef std::codecvt u32_codecvt; +#ifdef _GLIBCXX_USE_CHAR8_T +typedef std::codecvt u16u8_codecvt; +typedef std::codecvt u32u8_codecvt; +#endif #endif class gnu_facet: public std::locale::facet @@ -68,6 +72,10 @@ void test01() #ifdef _GLIBCXX_USE_C99_STDINT_TR1 VERIFY( has_facet(loc13) ); VERIFY( has_facet(loc13) ); +#ifdef _GLIBCXX_USE_CHAR8_T + VERIFY( has_facet(loc13) ); + VERIFY( has_facet(loc13) ); +#endif #endif VERIFY( has_facet(loc13) ); } diff --git a/libstdc++-v3/testsuite/29_atomics/atomic/cons/assign_neg.cc b/libstdc++-v3/testsuite/29_atomics/atomic/cons/assign_neg.cc index c9057b9c4d0..2431910f279 100644 --- a/libstdc++-v3/testsuite/29_atomics/atomic/cons/assign_neg.cc +++ b/libstdc++-v3/testsuite/29_atomics/atomic/cons/assign_neg.cc @@ -27,5 +27,5 @@ int main() return 0; } -// { dg-error "deleted" "" { target *-*-* } 620 } +// { dg-error "deleted" "" { target *-*-* } 639 } // { dg-prune-output "include" } diff --git a/libstdc++-v3/testsuite/29_atomics/atomic/cons/copy_neg.cc b/libstdc++-v3/testsuite/29_atomics/atomic/cons/copy_neg.cc index 129a8bedf99..f962fa656da 100644 --- a/libstdc++-v3/testsuite/29_atomics/atomic/cons/copy_neg.cc +++ b/libstdc++-v3/testsuite/29_atomics/atomic/cons/copy_neg.cc @@ -27,5 +27,5 @@ int main() return 0; } -// { dg-error "deleted" "" { target *-*-* } 659 } +// { dg-error "deleted" "" { target *-*-* } 678 } // { dg-prune-output "include" } diff --git a/libstdc++-v3/testsuite/29_atomics/atomic_integral/cons/assign_neg.cc b/libstdc++-v3/testsuite/29_atomics/atomic_integral/cons/assign_neg.cc index 320e1c99efc..381dfe7948e 100644 --- a/libstdc++-v3/testsuite/29_atomics/atomic_integral/cons/assign_neg.cc +++ b/libstdc++-v3/testsuite/29_atomics/atomic_integral/cons/assign_neg.cc @@ -28,5 +28,5 @@ int main() return 0; } -// { dg-error "deleted" "" { target *-*-* } 620 } +// { dg-error "deleted" "" { target *-*-* } 639 } // { dg-prune-output "include" } diff --git a/libstdc++-v3/testsuite/29_atomics/atomic_integral/cons/copy_neg.cc b/libstdc++-v3/testsuite/29_atomics/atomic_integral/cons/copy_neg.cc index 81a1cea26b0..19d898d31f7 100644 --- a/libstdc++-v3/testsuite/29_atomics/atomic_integral/cons/copy_neg.cc +++ b/libstdc++-v3/testsuite/29_atomics/atomic_integral/cons/copy_neg.cc @@ -28,5 +28,5 @@ int main() return 0; } -// { dg-error "deleted" "" { target *-*-* } 659 } +// { dg-error "deleted" "" { target *-*-* } 678 } // { dg-prune-output "include" } diff --git a/libstdc++-v3/testsuite/29_atomics/atomic_integral/is_always_lock_free.cc b/libstdc++-v3/testsuite/29_atomics/atomic_integral/is_always_lock_free.cc index 80d21f15243..127b47447f0 100644 --- a/libstdc++-v3/testsuite/29_atomics/atomic_integral/is_always_lock_free.cc +++ b/libstdc++-v3/testsuite/29_atomics/atomic_integral/is_always_lock_free.cc @@ -39,5 +39,8 @@ static_assert( check(ATOMIC_LONG_LOCK_FREE) ); static_assert( check(ATOMIC_LLONG_LOCK_FREE) ); static_assert( check(ATOMIC_LLONG_LOCK_FREE) ); static_assert( check(ATOMIC_WCHAR_T_LOCK_FREE) ); +#ifdef _GLIBCXX_USE_CHAR8_T +static_assert( check(ATOMIC_CHAR8_T_LOCK_FREE) ); +#endif static_assert( check(ATOMIC_CHAR16_T_LOCK_FREE) ); static_assert( check(ATOMIC_CHAR32_T_LOCK_FREE) ); diff --git a/libstdc++-v3/testsuite/29_atomics/atomic_integral/operators/bitwise_neg.cc b/libstdc++-v3/testsuite/29_atomics/atomic_integral/operators/bitwise_neg.cc index 646f823b01e..1ec82bc2e8f 100644 --- a/libstdc++-v3/testsuite/29_atomics/atomic_integral/operators/bitwise_neg.cc +++ b/libstdc++-v3/testsuite/29_atomics/atomic_integral/operators/bitwise_neg.cc @@ -26,8 +26,8 @@ int main() return 0; } -// { dg-error "operator" "" { target *-*-* } 476 } -// { dg-error "operator" "" { target *-*-* } 477 } -// { dg-error "operator" "" { target *-*-* } 478 } +// { dg-error "operator" "" { target *-*-* } 495 } +// { dg-error "operator" "" { target *-*-* } 496 } +// { dg-error "operator" "" { target *-*-* } 497 } // { dg-prune-output "declared here" } diff --git a/libstdc++-v3/testsuite/29_atomics/atomic_integral/operators/decrement_neg.cc b/libstdc++-v3/testsuite/29_atomics/atomic_integral/operators/decrement_neg.cc index 17ff1c29965..5479ceaf6fa 100644 --- a/libstdc++-v3/testsuite/29_atomics/atomic_integral/operators/decrement_neg.cc +++ b/libstdc++-v3/testsuite/29_atomics/atomic_integral/operators/decrement_neg.cc @@ -27,6 +27,6 @@ int main() return 0; } -// { dg-error "operator" "" { target *-*-* } 428 } -// { dg-error "operator" "" { target *-*-* } 429 } -// { dg-error "operator" "" { target *-*-* } 430 } +// { dg-error "operator" "" { target *-*-* } 447 } +// { dg-error "operator" "" { target *-*-* } 448 } +// { dg-error "operator" "" { target *-*-* } 449 } diff --git a/libstdc++-v3/testsuite/29_atomics/atomic_integral/operators/increment_neg.cc b/libstdc++-v3/testsuite/29_atomics/atomic_integral/operators/increment_neg.cc index f5452949617..9858a6c9f1b 100644 --- a/libstdc++-v3/testsuite/29_atomics/atomic_integral/operators/increment_neg.cc +++ b/libstdc++-v3/testsuite/29_atomics/atomic_integral/operators/increment_neg.cc @@ -27,6 +27,6 @@ int main() return 0; } -// { dg-error "operator" "" { target *-*-* } 406 } -// { dg-error "operator" "" { target *-*-* } 407 } -// { dg-error "operator" "" { target *-*-* } 408 } +// { dg-error "operator" "" { target *-*-* } 425 } +// { dg-error "operator" "" { target *-*-* } 426 } +// { dg-error "operator" "" { target *-*-* } 427 } diff --git a/libstdc++-v3/testsuite/experimental/polymorphic_allocator/pmr_typedefs_string.cc b/libstdc++-v3/testsuite/experimental/polymorphic_allocator/pmr_typedefs_string.cc index 757922177bd..62917e9373d 100644 --- a/libstdc++-v3/testsuite/experimental/polymorphic_allocator/pmr_typedefs_string.cc +++ b/libstdc++-v3/testsuite/experimental/polymorphic_allocator/pmr_typedefs_string.cc @@ -36,6 +36,12 @@ static_assert(std::is_same, xpmr::polymorphic_allocator>>::value, "pmr::string"); +#ifdef _GLIBCXX_USE_CHAR8_T +static_assert(std::is_same, + xpmr::polymorphic_allocator>>::value, + "pmr::u8string"); +#endif static_assert(std::is_same, xpmr::polymorphic_allocator>>::value, diff --git a/libstdc++-v3/testsuite/experimental/string_view/typedefs.cc b/libstdc++-v3/testsuite/experimental/string_view/typedefs.cc index 01756348fd4..d270ee6f8bf 100644 --- a/libstdc++-v3/testsuite/experimental/string_view/typedefs.cc +++ b/libstdc++-v3/testsuite/experimental/string_view/typedefs.cc @@ -24,12 +24,16 @@ template using check2_t = std::experimental::fundamentals_v1::string_view; +#ifdef _GLIBCXX_USE_CHAR8_T +using check3_t = std::experimental::fundamentals_v1::u8string_view; +#endif + #ifdef _GLIBCXX_USE_C99_STDINT_TR1 -using check3_t = std::experimental::fundamentals_v1::u16string_view; -using check4_t = std::experimental::fundamentals_v1::u32string_view; +using check4_t = std::experimental::fundamentals_v1::u16string_view; +using check5_t = std::experimental::fundamentals_v1::u32string_view; #endif #ifdef _GLIBCXX_USE_WCHAR_T -using check5_t = std::experimental::fundamentals_v1::wstring_view; +using check6_t = std::experimental::fundamentals_v1::wstring_view; #endif diff --git a/libstdc++-v3/testsuite/util/testsuite_common_types.h b/libstdc++-v3/testsuite/util/testsuite_common_types.h index c247f72e6fe..d992544b3aa 100644 --- a/libstdc++-v3/testsuite/util/testsuite_common_types.h +++ b/libstdc++-v3/testsuite/util/testsuite_common_types.h @@ -51,6 +51,7 @@ namespace __gnu_test { + using __gnu_cxx::typelist::null_type; using __gnu_cxx::typelist::node; using __gnu_cxx::typelist::transform; using __gnu_cxx::typelist::append; @@ -272,16 +273,23 @@ namespace __gnu_test typedef long long a11; typedef unsigned long long a12; typedef wchar_t a13; + typedef node<_GLIBCXX_TYPELIST_CHAIN13(a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13)> basic_typelist; #if __cplusplus >= 201103L typedef char16_t a14; typedef char32_t a15; - - typedef node<_GLIBCXX_TYPELIST_CHAIN15(a1, a2, a3, a4, a5, a6, a7, a8, a9, - a10, a11, a12, a13, a14, a15)> type; + typedef node<_GLIBCXX_TYPELIST_CHAIN2(a14, a15)> cxx11_typelist; #else - typedef node<_GLIBCXX_TYPELIST_CHAIN13(a1, a2, a3, a4, a5, a6, a7, a8, a9, - a10, a11, a12, a13)> type; + typedef node cxx11_typelist; +#endif +#ifdef _GLIBCXX_USE_CHAR8_T + typedef char8_t a16; + typedef node<_GLIBCXX_TYPELIST_CHAIN1(a16)> char8_typelist; +#else + typedef node char8_typelist; #endif + typedef typename append::type tl1; + typedef typename append::type type; }; // A typelist of all standard integral types + the GNU 128-bit types. @@ -300,32 +308,31 @@ namespace __gnu_test typedef long long a11; typedef unsigned long long a12; typedef wchar_t a13; + typedef node<_GLIBCXX_TYPELIST_CHAIN13(a1, a2, a3, a4, a5, a6, a7, a8, a9, + a10, a11, a12, a13)> basic_typelist; #if __cplusplus >= 201103L typedef char16_t a14; typedef char32_t a15; -# if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_INT128) - __extension__ typedef __int128 a16; - __extension__ typedef unsigned __int128 a17; - - typedef node<_GLIBCXX_TYPELIST_CHAIN17(a1, a2, a3, a4, a5, a6, a7, a8, a9, - a10, a11, a12, a13, a14, a15, - a16, a17)> type; -# else - typedef node<_GLIBCXX_TYPELIST_CHAIN15(a1, a2, a3, a4, a5, a6, a7, a8, a9, - a10, a11, a12, a13, a14, a15)> type; -# endif + typedef node<_GLIBCXX_TYPELIST_CHAIN2(a14, a15)> cxx11_typelist; +#else + typedef node cxx11_typelist; +#endif +#ifdef _GLIBCXX_USE_CHAR8_T + typedef char8_t a16; + typedef node<_GLIBCXX_TYPELIST_CHAIN1(a16)> char8_typelist; #else + typedef node char8_typelist; +#endif # if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_INT128) - __extension__ typedef __int128 a14; - __extension__ typedef unsigned __int128 a15; - - typedef node<_GLIBCXX_TYPELIST_CHAIN15(a1, a2, a3, a4, a5, a6, a7, a8, a9, - a10, a11, a12, a13, a14, a15)> type; -# else - typedef node<_GLIBCXX_TYPELIST_CHAIN13(a1, a2, a3, a4, a5, a6, a7, a8, a9, - a10, a11, a12, a13)> type; -# endif + __extension__ typedef __int128 a17; + __extension__ typedef unsigned __int128 a18; + typedef node<_GLIBCXX_TYPELIST_CHAIN2(a17, a18)> int128_typelist; +#else + typedef node int128_typelist; #endif + typedef typename append::type tl1; + typedef typename append::type tl2; + typedef typename append::type type; }; #if __cplusplus >= 201103L @@ -345,9 +352,15 @@ namespace __gnu_test typedef std::atomic_wchar_t a13; typedef std::atomic_char16_t a14; typedef std::atomic_char32_t a15; - - typedef node<_GLIBCXX_TYPELIST_CHAIN14(a2, a3, a4, a5, a6, a7, a8, a9, - a10, a11, a12, a13, a14, a15)> type; + typedef node<_GLIBCXX_TYPELIST_CHAIN14(a2, a3, a4, a5, a6, a7, a8, a9, a10, + a11, a12, a13, a14, a15)> basic_typelist; +#ifdef _GLIBCXX_USE_CHAR8_T + typedef std::atomic_char8_t a16; + typedef node<_GLIBCXX_TYPELIST_CHAIN1(a16)> char8_typelist; +#else + typedef node char8_typelist; +#endif + typedef typename append::type type; }; struct atomic_integrals @@ -367,9 +380,15 @@ namespace __gnu_test typedef std::atomic_wchar_t a13; typedef std::atomic_char16_t a14; typedef std::atomic_char32_t a15; - typedef node<_GLIBCXX_TYPELIST_CHAIN15(a1, a2, a3, a4, a5, a6, a7, a8, a9, - a10, a11, a12, a13, a14, a15)> type; + a10, a11, a12, a13, a14, a15)> basic_typelist; +#ifdef _GLIBCXX_USE_CHAR8_T + typedef std::atomic_char8_t a16; + typedef node<_GLIBCXX_TYPELIST_CHAIN1(a16)> char8_typelist; +#else + typedef node char8_typelist; +#endif + typedef typename append::type type; };