-// { 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;
-};
+}