From eed2a486c4115d698215cc8190338ac9641a91f4 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Mon, 22 Apr 2013 17:29:50 +0000 Subject: [PATCH] Apply patch from #8476. Fixes #8476. [SVN r84015] --- include/boost/regex/v4/basic_regex_creator.hpp | 8 ++++++++ include/boost/regex/v4/basic_regex_parser.hpp | 6 ++++++ include/boost/regex/v4/regex_format.hpp | 2 ++ 3 files changed, 16 insertions(+) diff --git a/include/boost/regex/v4/basic_regex_creator.hpp b/include/boost/regex/v4/basic_regex_creator.hpp index efb649cd..e38b7518 100644 --- a/include/boost/regex/v4/basic_regex_creator.hpp +++ b/include/boost/regex/v4/basic_regex_creator.hpp @@ -739,13 +739,16 @@ void basic_regex_creator::fixup_pointers(re_syntax_base* state) // set the state_id of this repeat: static_cast(state)->state_id = m_repeater_id++; // fall through: + BOOST_FALLTHROUGH; case syntax_element_alt: std::memset(static_cast(state)->_map, 0, sizeof(static_cast(state)->_map)); static_cast(state)->can_be_null = 0; // fall through: + BOOST_FALLTHROUGH; case syntax_element_jump: static_cast(state)->alt.p = getaddress(static_cast(state)->alt.i, state); // fall through again: + BOOST_FALLTHROUGH; default: if(state->next.i) state->next.p = getaddress(state->next.i, state); @@ -942,6 +945,7 @@ void basic_regex_creator::create_startmaps(re_syntax_base* state) } } // fall through: + BOOST_FALLTHROUGH; default: state = state->next.p; } @@ -1154,12 +1158,14 @@ void basic_regex_creator::create_startmap(re_syntax_base* state, } m_recursion_checks[recursion_sub] = true; // fall through, can't handle nested recursion here... + BOOST_FALLTHROUGH; } case syntax_element_backref: // can be null, and any character can match: if(pnull) *pnull |= mask; // fall through: + BOOST_FALLTHROUGH; case syntax_element_wild: { // can't be null, any character can match: @@ -1360,6 +1366,7 @@ void basic_regex_creator::create_startmap(re_syntax_base* state, break; } // otherwise fall through: + BOOST_FALLTHROUGH; default: state = state->next.p; } @@ -1538,6 +1545,7 @@ void basic_regex_creator::probe_leading_repeat(re_syntax_base* st if(this->m_has_backrefs == 0) static_cast(state)->leading = true; // fall through: + BOOST_FALLTHROUGH; default: return; } diff --git a/include/boost/regex/v4/basic_regex_parser.hpp b/include/boost/regex/v4/basic_regex_parser.hpp index 5dfb81e7..d875275f 100644 --- a/include/boost/regex/v4/basic_regex_parser.hpp +++ b/include/boost/regex/v4/basic_regex_parser.hpp @@ -370,6 +370,7 @@ bool basic_regex_parser::parse_extended() return true; } // Otherwise fall through: + BOOST_FALLTHROUGH; default: result = parse_literal(); break; @@ -624,6 +625,7 @@ bool basic_regex_parser::parse_basic_escape() case 'w': negate = false; // fall through: + BOOST_FALLTHROUGH; case 'W': { basic_char_set char_set; @@ -641,6 +643,7 @@ bool basic_regex_parser::parse_basic_escape() case 's': negate = false; // fall through: + BOOST_FALLTHROUGH; case 'S': return add_emacs_code(negate); case 'c': @@ -673,6 +676,7 @@ bool basic_regex_parser::parse_extended_escape() case regex_constants::escape_type_not_class: negate = true; // fall through: + BOOST_FALLTHROUGH; case regex_constants::escape_type_class: { escape_type_class_jump: @@ -743,6 +747,7 @@ escape_type_class_jump: case regex_constants::escape_type_not_property: negate = true; // fall through: + BOOST_FALLTHROUGH; case regex_constants::escape_type_property: { ++m_position; @@ -1960,6 +1965,7 @@ bool basic_regex_parser::parse_perl_extension() case regex_constants::syntax_or: m_mark_reset = m_mark_count; // fall through: + BOOST_FALLTHROUGH; case regex_constants::syntax_colon: // // a non-capturing mark: diff --git a/include/boost/regex/v4/regex_format.hpp b/include/boost/regex/v4/regex_format.hpp index 13198fc9..5249f7e0 100644 --- a/include/boost/regex/v4/regex_format.hpp +++ b/include/boost/regex/v4/regex_format.hpp @@ -284,6 +284,7 @@ void basic_regex_formatter::format break; } // fall through, not a special character: + BOOST_FALLTHROUGH; default: put(*m_position); ++m_position; @@ -355,6 +356,7 @@ void basic_regex_formatter::format have_brace = true; ++m_position; // fall through.... + BOOST_FALLTHROUGH; default: // see if we have a number: {