diff options
author | timshen <timshen@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-01-19 21:59:20 +0000 |
---|---|---|
committer | timshen <timshen@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-01-19 21:59:20 +0000 |
commit | 3b875a9d370662221e757f313b3adfa9275e8094 (patch) | |
tree | f636e0790ccdbf601305aa0cee588dcfbc4e30bc /libstdc++-v3/include | |
parent | 19de06314c90377eae14c760472eb2f220a2fe63 (diff) | |
download | ppe42-gcc-3b875a9d370662221e757f313b3adfa9275e8094.tar.gz ppe42-gcc-3b875a9d370662221e757f313b3adfa9275e8094.zip |
2014-01-19 Tim Shen <timshen91@gmail.com>
* include/bits/regex_compiler.h (_Comipler<>::_M_quantifier()):
Fix parse error of multiple consecutive quantifiers like "a**".
* include/bits/regex_compiler.tcc (_Comipler<>::_M_quantifier()):
Likewise.
* testsuite/28_regex/basic_regex/multiple_quantifiers.cc: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@206783 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include')
-rw-r--r-- | libstdc++-v3/include/bits/regex_compiler.h | 2 | ||||
-rw-r--r-- | libstdc++-v3/include/bits/regex_compiler.tcc | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/libstdc++-v3/include/bits/regex_compiler.h b/libstdc++-v3/include/bits/regex_compiler.h index 216f8fbebe4..fe2e5f1085c 100644 --- a/libstdc++-v3/include/bits/regex_compiler.h +++ b/libstdc++-v3/include/bits/regex_compiler.h @@ -83,7 +83,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION bool _M_assertion(); - void + bool _M_quantifier(); bool diff --git a/libstdc++-v3/include/bits/regex_compiler.tcc b/libstdc++-v3/include/bits/regex_compiler.tcc index 621e43f3ea3..128dac12bd7 100644 --- a/libstdc++-v3/include/bits/regex_compiler.tcc +++ b/libstdc++-v3/include/bits/regex_compiler.tcc @@ -135,7 +135,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION return true; if (this->_M_atom()) { - this->_M_quantifier(); + while (this->_M_quantifier()); return true; } return false; @@ -173,7 +173,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } template<typename _TraitsT> - void + bool _Compiler<_TraitsT>:: _M_quantifier() { @@ -276,6 +276,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION } _M_stack.push(__e); } + else + return false; + return true; } #define __INSERT_REGEX_MATCHER(__func, args...)\ |