]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libstdc++-v3/testsuite/28_regex/basic_regex/assign/char/cstring.cc
Update copyright years.
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / 28_regex / basic_regex / assign / char / cstring.cc
index bc4e61ff178e80d3ca213551848d405735e54538..b6de630ea171d517ee5f365d3b5039f0ebf51997 100644 (file)
@@ -1,9 +1,9 @@
-// { dg-do compile }
-// { dg-options "-std=c++0x" }
+// { dg-do run { target c++11 } }
+// { dg-timeout-factor 2 }
 
 // 2009-06-05  Stephen M. Webb  <stephen.webb@bregmasoft.ca>
 //
-// Copyright (C) 2009, 2011 Free Software Foundation, Inc.
+// Copyright (C) 2009-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
 // C++0X [28.8.3] class template basic_regex assign()
 
 #include <regex>
-#include <testsuite_hooks.h>
 
 // Tests assign operation from a C-style null-terminated-string.  
 void test01()
 {
-  bool test __attribute__((unused)) = true;
-
   std::basic_regex<char> re;
 
   const char* cs = "aab";
   re.assign(cs);
 }
 
+// basic_regex::operator=() resets flags. libstdc++/64680
+void test02()
+{
+  std::regex re("[[:alnum:]]", std::regex_constants::basic);
+  re = "\\w+";
+}
+
 int
 main()
 { 
   test01();
+  test02();
   return 0;
-};
+}