Fix testsuite failures with --disable-wchar_t
authorJonathan Wakely <jwakely@redhat.com>
Fri, 2 Oct 2015 23:43:17 +0000 (00:43 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Fri, 2 Oct 2015 23:43:17 +0000 (00:43 +0100)
* testsuite/21_strings/basic_string/literals/types.cc: Guard use of
wchar_t with _GLIBCXX_USE_WCHAR_T.
* testsuite/21_strings/basic_string/literals/values.cc: Likewise.
* testsuite/21_strings/basic_string/requirements/citerators.cc:
Likewise.
* testsuite/22_locale/messages/13631.cc: Likewise.
* testsuite/experimental/string_view/literals/types.cc: Likewise.
* testsuite/experimental/string_view/literals/values.cc: Likewise.

From-SVN: r228439

libstdc++-v3/ChangeLog
libstdc++-v3/testsuite/21_strings/basic_string/literals/types.cc
libstdc++-v3/testsuite/21_strings/basic_string/literals/values.cc
libstdc++-v3/testsuite/21_strings/basic_string/requirements/citerators.cc
libstdc++-v3/testsuite/22_locale/messages/13631.cc
libstdc++-v3/testsuite/experimental/string_view/literals/types.cc
libstdc++-v3/testsuite/experimental/string_view/literals/values.cc

index c70a3a0cc49aa5926dd14f793290825b539361fa..e973c62824df16a0a03ed96b273b034e54c162c1 100644 (file)
@@ -1,5 +1,14 @@
 2015-10-03  Jonathan Wakely  <jwakely@redhat.com>
 
+       * testsuite/21_strings/basic_string/literals/types.cc: Guard use of
+       wchar_t with _GLIBCXX_USE_WCHAR_T.
+       * testsuite/21_strings/basic_string/literals/values.cc: Likewise.
+       * testsuite/21_strings/basic_string/requirements/citerators.cc:
+       Likewise.
+       * testsuite/22_locale/messages/13631.cc: Likewise.
+       * testsuite/experimental/string_view/literals/types.cc: Likewise.
+       * testsuite/experimental/string_view/literals/values.cc: Likewise.
+
        * src/filesystem/Makefile.am: Add cxx11_abi_sources.
        * src/filesystem/Makefile.in: Regenerate.
        * src/filesystem/cow-dir.cc: New.
index 5a31acfe5c16208299fa3200a188d76456de6fcb..8922bf26010ebcba4717a0ba9100b9fd55fcab00 100644 (file)
@@ -32,8 +32,10 @@ test01()
   static_assert(std::is_same<decltype(u8"Hello"s), std::string>::value,
                "u8\"Hello\"s is std::string");
 
+#ifdef _GLIBCXX_USE_WCHAR_T
   static_assert(std::is_same<decltype(L"Hello"s), std::wstring>::value,
                "L\"Hello\"s is std::wstring");
+#endif
 
   static_assert(std::is_same<decltype(u"Hello"s), std::u16string>::value,
                "u\"Hello\"s is std::u16string");
index b8dc7d978069f6530c8ab606c67e77c7f41a9d33..bf60b9ea92c17ca5476ead0439bc04d6e6b923e3 100644 (file)
@@ -27,15 +27,19 @@ test01()
   using namespace std::literals::string_literals;
 
   std::string planet = "Mercury"s;
+#ifdef _GLIBCXX_USE_WCHAR_T
   std::wstring wplanet = L"Venus"s;
+#endif
   std::string u8planet = u8"Mars"s;
-  std::u16string u16planet = u"Juiter"s;
+  std::u16string u16planet = u"Jupiter"s;
   std::u32string u32planet = U"Saturn"s;
 
   VERIFY( planet == std::string("Mercury") );
+#ifdef _GLIBCXX_USE_WCHAR_T
   VERIFY( wplanet == std::wstring(L"Venus") );
+#endif
   VERIFY( u8planet == std::string(u8"Mars") );
-  VERIFY( u16planet == std::u16string(u"Juiter") );
+  VERIFY( u16planet == std::u16string(u"Jupiter") );
   VERIFY( u32planet == std::u32string(U"Saturn") );
 }
 
index f1dfff1f01aa9295d3a18cda4378d9f5d4690f33..533b3a666e85307d8276c2f527e75a7f8a86843c 100644 (file)
@@ -24,6 +24,8 @@
 int main()
 {
   __gnu_test::citerator<std::string> test1;
+#ifdef _GLIBCXX_USE_WCHAR_T
   __gnu_test::citerator<std::wstring> test2;
+#endif
   return 0;
 }
index 9feb42c732251b83027c4f95834a643efdb3e392..fb93c000f4c2f4c23878da8b648dbdd41acda2b7 100644 (file)
@@ -57,6 +57,7 @@ void test01()
 
 void test02()
 {
+#ifdef _GLIBCXX_USE_WCHAR_T
   bool test __attribute__((unused)) = true;
 
   // This is defined through CXXFLAGS in scripts/testsuite_flags[.in].
@@ -89,6 +90,7 @@ void test02()
   msgs_facet.close(msgs);
 
   VERIFY( translation1 == translation2 );
+#endif
 }
 
 int main()
index 8b91c99b04c44eebc8d7cbc9c3ec9adcc794c25e..bc2b2fc0a0709ce3b0b16166427c3d6d1b7b623f 100644 (file)
@@ -32,8 +32,10 @@ test01()
   static_assert(std::is_same<decltype(u8"Hello"sv), std::experimental::string_view>::value,
                "u8\"Hello\"s is std::string_view");
 
+#ifdef _GLIBCXX_USE_WCHAR_T
   static_assert(std::is_same<decltype(L"Hello"sv), std::experimental::wstring_view>::value,
                "L\"Hello\"s is std::wstring_view");
+#endif
 
   static_assert(std::is_same<decltype(u"Hello"sv), std::experimental::u16string_view>::value,
                "u\"Hello\"s is std::u16string_view");
index d96383b946132ed71864d9c209343fb58c8d1f7b..3dd6b78a9fcee823be6554b3e407ef446ed6adf8 100644 (file)
@@ -27,15 +27,19 @@ test01()
   using namespace std::experimental::literals::string_view_literals;
 
   std::experimental::string_view planet = "Mercury"sv;
+#ifdef _GLIBCXX_USE_WCHAR_T
   std::experimental::wstring_view wplanet = L"Venus"sv;
+#endif
   std::experimental::string_view u8planet = u8"Mars"sv;
-  std::experimental::u16string_view u16planet = u"Juiter"sv;
+  std::experimental::u16string_view u16planet = u"Jupiter"sv;
   std::experimental::u32string_view u32planet = U"Saturn"sv;
 
   VERIFY( planet == std::experimental::string_view("Mercury") );
+#ifdef _GLIBCXX_USE_WCHAR_T
   VERIFY( wplanet == std::experimental::wstring_view(L"Venus") );
+#endif
   VERIFY( u8planet == std::experimental::string_view(u8"Mars") );
-  VERIFY( u16planet == std::experimental::u16string_view(u"Juiter") );
+  VERIFY( u16planet == std::experimental::u16string_view(u"Jupiter") );
   VERIFY( u32planet == std::experimental::u32string_view(U"Saturn") );
 }