From ab6f20486bd00329146dd460fcc40fa180e36593 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Mon, 29 Nov 2004 13:50:17 +0000 Subject: [PATCH] Fix problem with match_any and POSIX-style matches (match results structure wasn't getting filled in). Fixed problem with gcc in -pedantic mode. [SVN r26348] --- include/boost/regex/v4/instances.hpp | 6 +++++- include/boost/regex/v4/perl_matcher_common.hpp | 5 +++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/include/boost/regex/v4/instances.hpp b/include/boost/regex/v4/instances.hpp index 007ffd35..9e9060ca 100644 --- a/include/boost/regex/v4/instances.hpp +++ b/include/boost/regex/v4/instances.hpp @@ -60,7 +60,11 @@ template class BOOST_REGEX_DECL reg_expression< BOOST_REGEX_CHAR_T >; #elif (defined(BOOST_MSVC) && defined(_MSC_EXTENSIONS)) || defined(__GNUC__) # ifndef BOOST_REGEX_INSTANTIATE -# define template extern template +# ifdef __GNUC__ +# define template __extension__ extern template +# else +# define template extern template +# endif # endif # ifdef BOOST_MSVC diff --git a/include/boost/regex/v4/perl_matcher_common.hpp b/include/boost/regex/v4/perl_matcher_common.hpp index 20148375..ad661d22 100644 --- a/include/boost/regex/v4/perl_matcher_common.hpp +++ b/include/boost/regex/v4/perl_matcher_common.hpp @@ -413,10 +413,11 @@ bool perl_matcher::match_match() m_presult->set_second(position); pstate = 0; m_has_found_match = true; - if((m_match_flags & (match_posix|match_any)) == match_posix) + if((m_match_flags & match_posix) == match_posix) { m_result.maybe_assign(*m_presult); - return false; + if((m_match_flags & match_any) == 0) + return false; } #ifdef BOOST_REGEX_MATCH_EXTRA if(match_extra & m_match_flags)