https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63775
--- Comment #4 from Tim Shen <timshen at gcc dot gnu.org> --- Author: timshen Date: Fri Jun 5 04:58:26 2015 New Revision: 224144 URL: https://gcc.gnu.org/viewcvs?rev=224144&root=gcc&view=rev Log: PR libstdc++/66359 Backport from mainline 2014-11-13 Tim Shen <tims...@google.com> PR libstdc++/63775 * include/bits/regex_compiler.h (_Compiler<>::_M_expression_term, _BracketMatcher<>::_M_make_range): Throw regex_erorr on invalid range like [z-a]. Change _M_expression_term interface. * include/bits/regex_compiler.tcc ( _Compiler<>::_M_insert_bracket_matcher, _Compiler<>::_M_expression_term): Rewrite bracket expression parsing. * testsuite/28_regex/algorithms/regex_match/cstring_bracket_01.cc: Add testcases and move file out of extended. Added: branches/gcc-4_9-branch/libstdc++-v3/testsuite/28_regex/algorithms/regex_match/cstring_bracket_01.cc Removed: branches/gcc-4_9-branch/libstdc++-v3/testsuite/28_regex/algorithms/regex_match/extended/cstring_bracket_01.cc Modified: branches/gcc-4_9-branch/libstdc++-v3/ChangeLog branches/gcc-4_9-branch/libstdc++-v3/include/bits/regex_compiler.h branches/gcc-4_9-branch/libstdc++-v3/include/bits/regex_compiler.tcc