Fix recursive expressions where the recursion appears more than once.

Fixes https://github.com/boostorg/regex/issues/87.
Also fix some more msvc warnings.
This commit is contained in:
jzmaddock
2020-01-23 19:24:33 +00:00
parent bc160a58f0
commit afc4229234
5 changed files with 18 additions and 5 deletions

View File

@ -546,7 +546,7 @@ typename w32_regex_traits_implementation<charT>::char_class_type
if(pos != m_custom_class_names.end())
return pos->second;
}
std::size_t state_id = 1 + BOOST_REGEX_DETAIL_NS::get_default_class_id(p1, p2);
std::size_t state_id = 1u + (std::size_t)BOOST_REGEX_DETAIL_NS::get_default_class_id(p1, p2);
if(state_id < sizeof(masks) / sizeof(masks[0]))
return masks[state_id];
return masks[0];