P0482R5 char8_t: Updates to existing standard library tests
authorTom Honermann <tom@honermann.net>
Fri, 22 Feb 2019 01:16:08 +0000 (01:16 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Fri, 22 Feb 2019 01:16:08 +0000 (01:16 +0000)
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  <tom@honermann.net>

* testsuite/18_support/byte/ops.cc: Validate
std::to_integer<char8_t>, std::to_integer<char16_t>, and
std::to_integer<char32_t>.
* testsuite/18_support/numeric_limits/dr559.cc: Validate
std::numeric_limits<char8_t>.
* testsuite/18_support/numeric_limits/lowest.cc: Validate
std::numeric_limits<char8_t>::lowest().
* testsuite/18_support/numeric_limits/max_digits10.cc: Validate
std::numeric_limits<char8_t>::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<char8_t>.
* testsuite/20_util/is_integral/value.cc: Validate
std::is_integral<char8_t>.
* testsuite/20_util/make_signed/requirements/typedefs-4.cc:
Validate std::make_signed<char8_t>.
* 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<char8_t> constexpr
member functions.
* testsuite/21_strings/char_traits/requirements/
constexpr_functions_c++17.cc: Validate char_traits<char8_t> 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<char16_t, char8_t, std::mbstate_t> and
std::codecvt<char32_t, char8_t, std::mbstate_t> 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<char8_t>::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

29 files changed:
libstdc++-v3/ChangeLog
libstdc++-v3/testsuite/18_support/byte/ops.cc
libstdc++-v3/testsuite/18_support/numeric_limits/dr559.cc
libstdc++-v3/testsuite/18_support/numeric_limits/lowest.cc
libstdc++-v3/testsuite/18_support/numeric_limits/max_digits10.cc
libstdc++-v3/testsuite/18_support/type_info/fundamental.cc
libstdc++-v3/testsuite/20_util/from_chars/1_c++20_neg.cc [new file with mode: 0644]
libstdc++-v3/testsuite/20_util/hash/requirements/explicit_instantiation.cc
libstdc++-v3/testsuite/20_util/is_integral/value.cc
libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-4.cc
libstdc++-v3/testsuite/21_strings/basic_string/cons/char/deduction.cc
libstdc++-v3/testsuite/21_strings/basic_string/types/pmr_typedefs.cc
libstdc++-v3/testsuite/21_strings/basic_string_view/operations/compare/char/70483.cc
libstdc++-v3/testsuite/21_strings/basic_string_view/typedefs.cc
libstdc++-v3/testsuite/21_strings/char_traits/requirements/constexpr_functions.cc
libstdc++-v3/testsuite/21_strings/char_traits/requirements/constexpr_functions_c++17.cc
libstdc++-v3/testsuite/21_strings/headers/string/types_std_c++0x.cc
libstdc++-v3/testsuite/22_locale/locale/cons/unicode.cc
libstdc++-v3/testsuite/29_atomics/atomic/cons/assign_neg.cc
libstdc++-v3/testsuite/29_atomics/atomic/cons/copy_neg.cc
libstdc++-v3/testsuite/29_atomics/atomic_integral/cons/assign_neg.cc
libstdc++-v3/testsuite/29_atomics/atomic_integral/cons/copy_neg.cc
libstdc++-v3/testsuite/29_atomics/atomic_integral/is_always_lock_free.cc
libstdc++-v3/testsuite/29_atomics/atomic_integral/operators/bitwise_neg.cc
libstdc++-v3/testsuite/29_atomics/atomic_integral/operators/decrement_neg.cc
libstdc++-v3/testsuite/29_atomics/atomic_integral/operators/increment_neg.cc
libstdc++-v3/testsuite/experimental/polymorphic_allocator/pmr_typedefs_string.cc
libstdc++-v3/testsuite/experimental/string_view/typedefs.cc
libstdc++-v3/testsuite/util/testsuite_common_types.h

index 904da1ba4c9036f650d83673790a95ec2008e369..b94e30f12a81c87ca6f8ab2ebbdbb8ecf7123c81 100644 (file)
@@ -1,3 +1,64 @@
+2019-02-22  Tom Honermann  <tom@honermann.net>
+
+       * testsuite/18_support/byte/ops.cc: Validate
+       std::to_integer<char8_t>, std::to_integer<char16_t>, and
+       std::to_integer<char32_t>.
+       * testsuite/18_support/numeric_limits/dr559.cc: Validate
+       std::numeric_limits<char8_t>.
+       * testsuite/18_support/numeric_limits/lowest.cc: Validate
+       std::numeric_limits<char8_t>::lowest().
+       * testsuite/18_support/numeric_limits/max_digits10.cc: Validate
+       std::numeric_limits<char8_t>::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<char8_t>.
+       * testsuite/20_util/is_integral/value.cc: Validate
+       std::is_integral<char8_t>.
+       * testsuite/20_util/make_signed/requirements/typedefs-4.cc:
+       Validate std::make_signed<char8_t>.
+       * 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<char8_t> constexpr
+       member functions.
+       * testsuite/21_strings/char_traits/requirements/
+       constexpr_functions_c++17.cc: Validate char_traits<char8_t> 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<char16_t, char8_t, std::mbstate_t> and
+       std::codecvt<char32_t, char8_t, std::mbstate_t> 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<char8_t>::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  <tom@honermann.net>
 
        * include/ext/typelist.h: Constrain a partial specialization of
index 37a75fa2a324374b09a700fae438ee063de80416..6b01c1c38f00f6ebfbe9e24160884c2b2540d712 100644 (file)
@@ -218,7 +218,15 @@ constexpr bool test_to_integer(unsigned char c)
 
 static_assert( test_to_integer<int>(0) );
 static_assert( test_to_integer<int>(255) );
+static_assert( test_to_integer<signed char>(0) );
 static_assert( test_to_integer<signed char>(255) );
 static_assert( test_to_integer<unsigned>(0) );
 static_assert( test_to_integer<unsigned>(255) );
-
+#ifdef _GLIBCXX_USE_CHAR8_T
+static_assert( test_to_integer<char8_t>(0) );
+static_assert( test_to_integer<char8_t>(255) );
+#endif
+static_assert( test_to_integer<char16_t>(0) );
+static_assert( test_to_integer<char16_t>(255) );
+static_assert( test_to_integer<char32_t>(0) );
+static_assert( test_to_integer<char32_t>(255) );
index bf6dac73b0ba4e1af775d295cffffe33943515f1..504866b636aef23794c69b1837659cc010075a93 100644 (file)
@@ -84,6 +84,9 @@ int main()
   do_test<signed char>();
   do_test<unsigned char>();
   do_test<wchar_t>();
+#ifdef _GLIBCXX_USE_CHAR8_T
+  do_test<char8_t>();
+#endif
   do_test<char16_t>();
   do_test<char32_t>();
   do_test<short>();
index 85466c5b5384df01ca1c4c218762a2858ec5465b..82d9a0f9bf00a7a313c4f1724d997763bf42b74d 100644 (file)
@@ -54,6 +54,9 @@ void test01()
   do_test<unsigned char>();
 #ifdef _GLIBCXX_USE_WCHAR_T
   do_test<wchar_t>();
+#endif
+#ifdef _GLIBCXX_USE_CHAR8_T
+  do_test<char8_t>();
 #endif
   do_test<char16_t>();
   do_test<char32_t>();
index c0c3ab8aac84789916af17982e23b86960aa0b9b..c5475c508fd843bb8f2b35dc37ec4ac1da8d7ff4 100644 (file)
@@ -42,6 +42,9 @@ test01()
   VERIFY( std::numeric_limits<unsigned long>::max_digits10 == 0 );
   VERIFY( std::numeric_limits<long long>::max_digits10 == 0 );
   VERIFY( std::numeric_limits<unsigned long long>::max_digits10 == 0 );
+#ifdef _GLIBCXX_USE_CHAR8_T
+  VERIFY( std::numeric_limits<char8_t>::max_digits10 == 0 );
+#endif
   VERIFY( std::numeric_limits<char16_t>::max_digits10 == 0 );
   VERIFY( std::numeric_limits<char32_t>::max_digits10 == 0 );
 
index 812c0103c685de5e8e7ded23463afbb0121f0a7b..717ebd6e149f57e5f01c0abdda7881a7189ff39e 100644 (file)
@@ -50,6 +50,9 @@ int main()
   gen_type_info<long long>();
   gen_type_info<unsigned long long>();
   gen_type_info<wchar_t>();
+#ifdef _GLIBCXX_USE_CHAR8_T
+  gen_type_info<char8_t>();
+#endif
   gen_type_info<char16_t>();
   gen_type_info<char32_t>();
 
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 (file)
index 0000000..83d2976
--- /dev/null
@@ -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
+// <http://www.gnu.org/licenses/>.
+
+// { dg-options "-std=gnu++2a" }
+// { dg-do compile { target c++2a } }
+
+#include <charconv>
+
+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" }
+}
index f143b4d910e031299816ae7ca8789b28a802e8c7..ff390fb5a34739922bab56cd5f69c81c4679cbd7 100644 (file)
@@ -26,6 +26,9 @@ template class std::hash<bool>;
 template class std::hash<char>;
 template class std::hash<signed char>;
 template class std::hash<unsigned char>;
+#ifdef _GLIBCXX_USE_CHAR8_T
+template class std::hash<char8_t>;
+#endif
 template class std::hash<char16_t>;
 template class std::hash<char32_t>;
 template class std::hash<short>;
index 1e3c2e87f3a687bc16de2f1d1a64267254b9dbe1..1c3c412b94efba192642e74424faee414c4451d7 100644 (file)
@@ -34,6 +34,9 @@ void test01()
   static_assert(test_category<is_integral, unsigned char>(true), "");
 #ifdef _GLIBCXX_USE_WCHAR_T
   static_assert(test_category<is_integral, wchar_t>(true), "");
+#endif
+#ifdef _GLIBCXX_USE_CHAR8_T
+  static_assert(test_category<is_integral, char8_t>(true), "");
 #endif
   static_assert(test_category<is_integral, char16_t>(true), "");
   static_assert(test_category<is_integral, char32_t>(true), "");
index 41744661454afc0721f8e9bb89012b8363ad1f7b..27eb1012125bf38674129896a019e1e846d9b10b 100644 (file)
@@ -27,5 +27,8 @@ using wchar_signed = make_signed<wchar_t>::type;
 using wchar_unsigned = make_unsigned<wchar_t>::type;
 static_assert( !is_same<wchar_signed, wchar_unsigned>::value, "wchar_t" );
 #endif
+#ifdef _GLIBCXX_USE_CHAR8_T
+static_assert( is_signed<make_signed<char8_t>::type>::value, "char8_t");
+#endif
 static_assert( is_signed<make_signed<char16_t>::type>::value, "char16_t");
 static_assert( is_signed<make_signed<char32_t>::type>::value, "char32_t");
index a6ffc41309e53dd4b830aee5fa1c4478eb3380c0..6bb2554f07d0228b912365aaaf1817f15f5228eb 100644 (file)
@@ -122,6 +122,27 @@ test04()
 
 void
 test05()
+{
+#ifdef _GLIBCXX_USE_CHAR8_T
+  char8_t a[1] = {};
+  input_iterator_seq<char8_t> seq(a);
+
+  std::basic_string s1(seq.begin(), seq.end());
+  check_type<std::u8string>(s1);
+
+  std::basic_string s2(seq.begin(), seq.end(), std::allocator<char8_t>());
+  check_type<std::u8string>(s2);
+
+  std::basic_string s3((char8_t)1, u8'a');
+  check_type<std::u8string>(s3);
+
+  std::basic_string s4((char8_t)1, u8'a', std::allocator<char8_t>());
+  check_type<std::u8string>(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;
index 8565170d26ea2c88dd3a9261e85fa0c7ce6dfeb1..4b443570ccdc06f19428e31fb2216c1cd5b811e9 100644 (file)
@@ -33,6 +33,11 @@ static_assert(std::is_same_v<std::pmr::basic_string<char, T>,
 static_assert(std::is_same_v<std::pmr::string,
     std::basic_string<char, std::char_traits<char>,
                      std::pmr::polymorphic_allocator<char>>>);
+#ifdef _GLIBCXX_USE_CHAR8_T
+static_assert(std::is_same_v<std::pmr::u8string,
+    std::basic_string<char8_t, std::char_traits<char8_t>,
+                     std::pmr::polymorphic_allocator<char8_t>>>);
+#endif
 static_assert(std::is_same_v<std::pmr::u16string,
     std::basic_string<char16_t, std::char_traits<char16_t>,
                      std::pmr::polymorphic_allocator<char16_t>>>);
index 9315d3b659535a9f19846a2b5ea0eb19ec71157d..29facb1eea74d41df1a5d67b802073d0369fc626 100644 (file)
@@ -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<char>;
+#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
index 277d7ce8bcf25342da7d186aeb9b552938f7da02..82bbe84f90916661a2fe0bffe8a26be988e6bd7a 100644 (file)
@@ -25,12 +25,15 @@ template<typename C, typename T>
 
 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
-
index 239aa48fcf70703d6ba68c45aca496b2b8ed5c4f..93815ff6979f43115b22547e577226fad1419cfa 100644 (file)
@@ -66,6 +66,9 @@ int main()
   test.operator()<std::char_traits<char>>();
 #ifdef _GLIBCXX_USE_WCHAR_T
   test.operator()<std::char_traits<wchar_t>>();
+#endif
+#ifdef _GLIBCXX_USE_CHAR8_T
+  test.operator()<std::char_traits<char8_t>>();
 #endif
   test.operator()<std::char_traits<char16_t>>();
   test.operator()<std::char_traits<char32_t>>();
index db368ecb60af972248f2275f5ee8a824e88ecddc..92c301b19006e75acd3e75d0f6c56d6393229263 100644 (file)
@@ -89,6 +89,12 @@ static_assert( test_compare<std::char_traits<wchar_t>>() );
 static_assert( test_length<std::char_traits<wchar_t>>() );
 static_assert( test_find<std::char_traits<wchar_t>>() );
 #endif
+#ifdef _GLIBCXX_USE_CHAR8_T
+static_assert( test_assign<std::char_traits<char8_t>>() );
+static_assert( test_compare<std::char_traits<char8_t>>() );
+static_assert( test_length<std::char_traits<char8_t>>() );
+static_assert( test_find<std::char_traits<char8_t>>() );
+#endif
 static_assert( test_assign<std::char_traits<char16_t>>() );
 static_assert( test_compare<std::char_traits<char16_t>>() );
 static_assert( test_length<std::char_traits<char16_t>>() );
index ab4440541e09c87e6f26e4d8e6c5fcc5385b78e7..6e5cf8c78e67a9c045e08d4c76a3b4bfa9b00ff7 100644 (file)
@@ -21,6 +21,9 @@
 
 namespace gnu
 {
+#ifdef _GLIBCXX_USE_CHAR8_T
+  typedef std::u8string t2;
+#endif
   typedef std::u16string t3;
   typedef std::u32string t4;
 }
index fb8e12113f5c518b8b741dca5f0a82bfa62c125b..21b753412372eae2783a05445bf931854922fa53 100644 (file)
@@ -36,6 +36,10 @@ typedef std::codecvt<wchar_t, char, std::mbstate_t>        w_codecvt;
 #ifdef _GLIBCXX_USE_C99_STDINT_TR1
 typedef std::codecvt<char16_t, char, std::mbstate_t>         u16_codecvt;
 typedef std::codecvt<char32_t, char, std::mbstate_t>         u32_codecvt;
+#ifdef _GLIBCXX_USE_CHAR8_T
+typedef std::codecvt<char16_t, char8_t, std::mbstate_t>              u16u8_codecvt;
+typedef std::codecvt<char32_t, char8_t, std::mbstate_t>              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<u16_codecvt>(loc13) );
       VERIFY( has_facet<u32_codecvt>(loc13) );
+#ifdef _GLIBCXX_USE_CHAR8_T
+      VERIFY( has_facet<u16u8_codecvt>(loc13) );
+      VERIFY( has_facet<u32u8_codecvt>(loc13) );
+#endif
 #endif
       VERIFY( has_facet<unicode_codecvt>(loc13) );
     }
index c9057b9c4d024661f9754e19c844919d85841b08..2431910f279e4c1f634ea1f2ef89fcecca7de1cd 100644 (file)
@@ -27,5 +27,5 @@ int main()
   return 0;
 }
 
-// { dg-error "deleted" "" { target *-*-* } 620 }
+// { dg-error "deleted" "" { target *-*-* } 639 }
 // { dg-prune-output "include" }
index 129a8bedf9909f255e66c8605c86a650f8b6d06a..f962fa656da3f6da9890739551a4563fb45fe65b 100644 (file)
@@ -27,5 +27,5 @@ int main()
   return 0;
 }
 
-// { dg-error "deleted" "" { target *-*-* } 659 }
+// { dg-error "deleted" "" { target *-*-* } 678 }
 // { dg-prune-output "include" }
index 320e1c99efc80a3f4b2475bcc6ff83efd7b7d967..381dfe7948e9bec502cff307f3fc88f4f682c496 100644 (file)
@@ -28,5 +28,5 @@ int main()
   return 0;
 }
 
-// { dg-error "deleted" "" { target *-*-* } 620 }
+// { dg-error "deleted" "" { target *-*-* } 639 }
 // { dg-prune-output "include" }
index 81a1cea26b0db9e4d4fa179e540b7f2890608acd..19d898d31f7cf5e097cd440c7d34a5d6aaead64a 100644 (file)
@@ -28,5 +28,5 @@ int main()
   return 0;
 }
 
-// { dg-error "deleted" "" { target *-*-* } 659 }
+// { dg-error "deleted" "" { target *-*-* } 678 }
 // { dg-prune-output "include" }
index 80d21f15243e9d0bd201c98a283098bfcb473cc2..127b47447f03797a4cf8bb4455f9afe9de7955d7 100644 (file)
@@ -39,5 +39,8 @@ static_assert( check<unsigned long>(ATOMIC_LONG_LOCK_FREE) );
 static_assert( check<long long>(ATOMIC_LLONG_LOCK_FREE) );
 static_assert( check<unsigned long long>(ATOMIC_LLONG_LOCK_FREE) );
 static_assert( check<wchar_t>(ATOMIC_WCHAR_T_LOCK_FREE) );
+#ifdef _GLIBCXX_USE_CHAR8_T
+static_assert( check<char8_t>(ATOMIC_CHAR8_T_LOCK_FREE) );
+#endif
 static_assert( check<char16_t>(ATOMIC_CHAR16_T_LOCK_FREE) );
 static_assert( check<char32_t>(ATOMIC_CHAR32_T_LOCK_FREE) );
index 646f823b01e1eca81217fa6b436e44a6dbeb7412..1ec82bc2e8ffd82e4072622d99ea9b94c203a82e 100644 (file)
@@ -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" }
index 17ff1c299656a5a3371fa29f510b2959dd2cb8b7..5479ceaf6fa2e0d0e62e5d48f58feb566456adb2 100644 (file)
@@ -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 }
index f5452949617242f86d2bfe346e41176b3f885020..9858a6c9f1b8d51a1bc5a30a05d97c38d618af68 100644 (file)
@@ -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 }
index 757922177bda9f5d3bce1781af6ff30e2c8b7edb..62917e9373d1a9e778cc0877b14f1c3c31690cc4 100644 (file)
@@ -36,6 +36,12 @@ static_assert(std::is_same<xpmr::string,
     std::basic_string<char, std::char_traits<char>,
                      xpmr::polymorphic_allocator<char>>>::value,
     "pmr::string");
+#ifdef _GLIBCXX_USE_CHAR8_T
+static_assert(std::is_same<xpmr::u8string,
+    std::basic_string<char8_t, std::char_traits<char8_t>,
+                     xpmr::polymorphic_allocator<char8_t>>>::value,
+    "pmr::u8string");
+#endif
 static_assert(std::is_same<xpmr::u16string,
     std::basic_string<char16_t, std::char_traits<char16_t>,
                      xpmr::polymorphic_allocator<char16_t>>>::value,
index 01756348fd4a4344dd0bf094574d67a4a6c0eb0c..d270ee6f8bf06e8144620435a2a064661a4ec45e 100644 (file)
@@ -24,12 +24,16 @@ template<typename C, typename T>
 
 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
 
index c247f72e6fe41dbeea880c04f235aa0b1a622986..d992544b3aa7160c2097f9e247c5c93eb91c76f6 100644 (file)
@@ -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<null_type> cxx11_typelist;
+#endif
+#ifdef _GLIBCXX_USE_CHAR8_T
+    typedef char8_t            a16;
+    typedef node<_GLIBCXX_TYPELIST_CHAIN1(a16)> char8_typelist;
+#else
+    typedef node<null_type> char8_typelist;
 #endif
+    typedef typename append<basic_typelist, cxx11_typelist>::type tl1;
+    typedef typename append<tl1, char8_typelist>::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<null_type> cxx11_typelist;
+#endif
+#ifdef _GLIBCXX_USE_CHAR8_T
+    typedef char8_t            a16;
+    typedef node<_GLIBCXX_TYPELIST_CHAIN1(a16)> char8_typelist;
 #else
+    typedef node<null_type> 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<null_type> int128_typelist;
 #endif
+    typedef typename append<basic_typelist, cxx11_typelist>::type tl1;
+    typedef typename append<tl1, char8_typelist>::type            tl2;
+    typedef typename append<tl2, int128_typelist>::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<null_type> char8_typelist;
+#endif
+    typedef typename append<basic_typelist, char8_typelist>::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<null_type> char8_typelist;
+#endif
+    typedef typename append<basic_typelist, char8_typelist>::type type;
   };