]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libstdc++-v3/testsuite/21_strings/basic_string/literals/values.cc
Update copyright years.
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / 21_strings / basic_string / literals / values.cc
index e4fdc5f2f5d8199b0f0827dbee7e02ac6c2bb4d8..51d35a1f6bb77c83ffdfc15f2b44dad143ce3772 100644 (file)
@@ -1,7 +1,6 @@
-// { dg-do run }
-// { dg-options "-std=gnu++14" }
+// { dg-do run { target c++14 } }
 
-// Copyright (C) 2013-2016 Free Software Foundation, Inc.
+// Copyright (C) 2013-2024 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
 #include <string>
 #include <testsuite_hooks.h>
 
+#ifdef _GLIBCXX_USE_CHAR8_T
+using std::u8string;
+#else
+using u8string = std::string;
+#endif
+
 void
 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;
+  u8string u8planet = u8"Mars"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( u8planet == u8string(u8"Mars") );
   VERIFY( u16planet == std::u16string(u"Jupiter") );
   VERIFY( u32planet == std::u32string(U"Saturn") );
 }