From f2738d6cf2deaae25fceafaff8012305cb9ec8ab Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Sun, 31 Jul 2016 19:46:30 +0100 Subject: [PATCH] Fix non-portable std::regex test and test more cases * testsuite/28_regex/basic_regex/ctors/basic/raw_string.cc: Fix test to not rely on GNU extension (escaped normal characters in POSIX BRE). Enable tests for other strings which are now supported. From-SVN: r238926 --- libstdc++-v3/ChangeLog | 4 ++++ .../basic_regex/ctors/basic/raw_string.cc | 17 +++++++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 9c3af44ee81..a878d1e2465 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,9 @@ 2016-07-31 Jonathan Wakely + * testsuite/28_regex/basic_regex/ctors/basic/raw_string.cc: Fix + test to not rely on GNU extension (escaped normal characters in POSIX + BRE). Enable tests for other strings which are now supported. + * testsuite/20_util/pair/astuple/get_neg.cc: Use effective-target c++11 instead of setting -std=gnu++14. diff --git a/libstdc++-v3/testsuite/28_regex/basic_regex/ctors/basic/raw_string.cc b/libstdc++-v3/testsuite/28_regex/basic_regex/ctors/basic/raw_string.cc index 5625653d7f9..758f216b0a9 100644 --- a/libstdc++-v3/testsuite/28_regex/basic_regex/ctors/basic/raw_string.cc +++ b/libstdc++-v3/testsuite/28_regex/basic_regex/ctors/basic/raw_string.cc @@ -1,4 +1,3 @@ -// { dg-options "-std=gnu++11" } // 2012-08-20 Benjamin Kosnik // @@ -31,17 +30,27 @@ test01() // raw string literals - //string_type sre0(R"(\d{3}-\d{3}-\d{4})"); // expected fail + string_type sre0(R"(\d{3}-\d{3}-\d{4})"); - string_type sre1(R"( this\n and new : forms\n )"); + string_type sre1(R"( this + and new : forms + )"); string_type sre2(R"([:num:]{3}-[:num:]{3}-[:num:]{4})"); // 1 - regex_type re(R"( this\n and new : forms\n )", std::regex::basic); + regex_type re0(R"(\d{3}-\d{3}-\d{4})", std::regex::ECMAScript); + + regex_type re1(R"( this + and new : forms + )", std::regex::basic); + + regex_type re2(R"([:num:]{3}-[:num:]{3}-[:num:]{4})", std::regex::basic); // 2 + regex_sanity_check(sre0, std::regex::ECMAScript); regex_sanity_check(sre1); + regex_sanity_check(sre2); } int main() -- 2.30.2