]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libstdc++-v3/testsuite/experimental/string_view/element_access/wchar_t/1.cc
Update copyright years.
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / experimental / string_view / element_access / wchar_t / 1.cc
index f7b966ad82838e253d20a5adf9f41f38cabb3fa5..8f3b3b5d646becb4839ecee78a02ebcdbc1041b6 100644 (file)
@@ -1,6 +1,6 @@
-// { dg-options "-std=gnu++1y" }
+// { dg-do run { target c++14 } }
 
-// Copyright (C) 2013 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 <stdexcept>
 #include <testsuite_hooks.h>
 
-bool
+void
 test01()
 {
-  bool test [[gnu::unused]] = true;
-
   typedef std::experimental::wstring_view::size_type csize_type;
   typedef std::experimental::wstring_view::const_reference cref;
   typedef std::experimental::wstring_view::reference ref;
@@ -41,8 +39,9 @@ test01()
   csz01 = str01.size();
   cref cref1 = str01[csz01 - 1];
   VERIFY( cref1 == L'a' );
-  cref cref2 = str01[csz01];
-  VERIFY( cref2 == wchar_t() );
+  // Undefined behavior at size().
+  //cref cref2 = str01[csz01];
+  //VERIFY( cref2 == wchar_t() );
 
   // const_reference at(size_type pos) const;
   csz01 = str01.size();
@@ -61,8 +60,6 @@ test01()
   {
     VERIFY( false );
   }
-
-  return test;
 }
 
 int