From 4ec21835cbed3f28c7939dcc72795c28dc6dc46a Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Fri, 25 Apr 2014 17:10:25 +0100 Subject: [PATCH] re PR libstdc++/60958 (Initialization of arrays in tr1/regex ill-formed or with undefined behaviour) PR libstdc++/60958 * include/tr1/regex (regex_traits::isctype): Comment out broken code. * testsuite/util/testsuite_regex.h (regex_match_debug): Improve comment. From-SVN: r209807 --- libstdc++-v3/ChangeLog | 7 +++++++ libstdc++-v3/include/tr1/regex | 4 ++-- libstdc++-v3/testsuite/util/testsuite_regex.h | 4 ++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 75853f84e4b..eace534a30b 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,10 @@ +2014-04-25 Jonathan Wakely + + PR libstdc++/60958 + * include/tr1/regex (regex_traits::isctype): Comment out broken code. + * testsuite/util/testsuite_regex.h (regex_match_debug): Improve + comment. + 2014-04-25 Marc Glisse * testsuite/util/testsuite_abi.cc (check_version): Update for diff --git a/libstdc++-v3/include/tr1/regex b/libstdc++-v3/include/tr1/regex index 3cff23a2656..0387472ddcc 100644 --- a/libstdc++-v3/include/tr1/regex +++ b/libstdc++-v3/include/tr1/regex @@ -678,7 +678,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION if (__ctype.is(__c, __f)) return true; - +#if 0 // special case of underscore in [[:w:]] if (__c == __ctype.widen('_')) { @@ -698,7 +698,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION if (__f | __bt) return true; } - +#endif return false; } diff --git a/libstdc++-v3/testsuite/util/testsuite_regex.h b/libstdc++-v3/testsuite/util/testsuite_regex.h index 9460ed6ae31..c2031e90a23 100644 --- a/libstdc++-v3/testsuite/util/testsuite_regex.h +++ b/libstdc++-v3/testsuite/util/testsuite_regex.h @@ -131,7 +131,7 @@ namespace __gnu_test // regex_match_debug behaves like regex_match, but will run *two* executors // (if there's no back-reference) and check if their results agree. If not, - // an exception throws. One can use them just in the way of using regex_match. + // an exception is thrown. The arguments are the same as for regex_match. template bool @@ -153,7 +153,7 @@ namespace __gnu_test // __m is unspecified if return value is false. if (__res1 == __res2 && (!__res1 || __m == __mm)) return __res1; - throw(std::exception()); + throw std::exception(); } // No match_results version