]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libstdc++-v3/testsuite/21_strings/basic_string_view/literals/types.cc
Update copyright years.
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / 21_strings / basic_string_view / literals / types.cc
index ac0cc8f5027c1d76b05560654f9fc03e14e0117a..9a30a6cabeed2388bcb3a3350ab6901309c2b843 100644 (file)
@@ -1,7 +1,7 @@
 // { dg-options "-std=gnu++17" }
-// { dg-do compile }
+// { dg-do compile { target c++17 } }
 
-// Copyright (C) 2013-2017 Free Software Foundation, Inc.
+// Copyright (C) 2013-2021 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_view>
 #include <type_traits>
 
+#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<decltype("Hello"sv), std::string_view>::value,
                "\"Hello\"s is std::string_view");
 
-  static_assert(std::is_same<decltype(u8"Hello"sv), std::string_view>::value,
+  static_assert(std::is_same<decltype(u8"Hello"sv), u8string_view>::value,
                "u8\"Hello\"s is std::string_view");
 
 #ifdef _GLIBCXX_USE_WCHAR_T