From 2cd947f7c41174b1d9f8587801b6e997ad2a9a29 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Mon, 20 Jan 2020 19:51:46 +0000 Subject: [PATCH 1/2] Suppress msvc warnings. Fixes: https://github.com/boostorg/regex/issues/80 --- include/boost/regex/pattern_except.hpp | 5 +++- include/boost/regex/pending/object_cache.hpp | 7 +++++ include/boost/regex/v4/basic_regex.hpp | 14 +++++++-- .../boost/regex/v4/basic_regex_creator.hpp | 10 ++++++- include/boost/regex/v4/basic_regex_parser.hpp | 30 ++++++++++++++++--- include/boost/regex/v4/cpp_regex_traits.hpp | 2 +- include/boost/regex/v4/match_flags.hpp | 12 ++++++++ include/boost/regex/v4/match_results.hpp | 2 +- include/boost/regex/v4/perl_matcher.hpp | 21 +++++++++++-- .../boost/regex/v4/perl_matcher_common.hpp | 12 +++++++- include/boost/regex/v4/regex_format.hpp | 7 +++++ .../boost/regex/v4/regex_token_iterator.hpp | 8 ++--- src/cregex.cpp | 7 +++++ src/fileiter.cpp | 21 ++++++++----- src/posix_api.cpp | 7 +++++ src/regex.cpp | 2 +- src/wide_posix_api.cpp | 7 +++++ test/regress/info.hpp | 2 +- test/regress/test.hpp | 2 +- 19 files changed, 150 insertions(+), 28 deletions(-) diff --git a/include/boost/regex/pattern_except.hpp b/include/boost/regex/pattern_except.hpp index 004b67f3f..e3d202e09 100644 --- a/include/boost/regex/pattern_except.hpp +++ b/include/boost/regex/pattern_except.hpp @@ -43,13 +43,16 @@ namespace boost{ #ifdef BOOST_MSVC #pragma warning(push) #pragma warning(disable : 4275) +#if BOOST_MSVC >= 1800 +#pragma warning(disable : 26812) +#endif #endif class BOOST_REGEX_DECL regex_error : public std::runtime_error { public: explicit regex_error(const std::string& s, regex_constants::error_type err = regex_constants::error_unknown, std::ptrdiff_t pos = 0); explicit regex_error(regex_constants::error_type err); - ~regex_error() throw(); + ~regex_error() BOOST_NOEXCEPT; regex_constants::error_type code()const { return m_error_code; } std::ptrdiff_t position()const diff --git a/include/boost/regex/pending/object_cache.hpp b/include/boost/regex/pending/object_cache.hpp index c47862f0e..ea51ba3a3 100644 --- a/include/boost/regex/pending/object_cache.hpp +++ b/include/boost/regex/pending/object_cache.hpp @@ -57,6 +57,10 @@ class object_cache friend struct data; }; +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable: 4702) +#endif template boost::shared_ptr object_cache::get(const Key& k, size_type l_max_cache_size) { @@ -80,6 +84,9 @@ boost::shared_ptr object_cache::get(const Key& k, siz return do_get(k, l_max_cache_size); #endif } +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif template boost::shared_ptr object_cache::do_get(const Key& k, size_type l_max_cache_size) diff --git a/include/boost/regex/v4/basic_regex.hpp b/include/boost/regex/v4/basic_regex.hpp index b3bb1fe0d..b28b17c79 100644 --- a/include/boost/regex/v4/basic_regex.hpp +++ b/include/boost/regex/v4/basic_regex.hpp @@ -170,9 +170,19 @@ struct regex_data : public named_subexpressions regex_data(const ::boost::shared_ptr< ::boost::regex_traits_wrapper >& t) - : m_ptraits(t), m_expression(0), m_expression_len(0), m_disable_match_any(false) {} + : m_ptraits(t), m_flags(0), m_status(0), m_expression(0), m_expression_len(0), + m_mark_count(0), m_first_state(0), m_restart_type(0), +#if !defined(BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX) && !(defined(BOOST_MSVC) && (BOOST_MSVC < 1900)) + m_startmap{ 0 }, +#endif + m_can_be_null(0), m_word_mask(0), m_has_recursions(false), m_disable_match_any(false) {} regex_data() - : m_ptraits(new ::boost::regex_traits_wrapper()), m_expression(0), m_expression_len(0), m_disable_match_any(false) {} + : m_ptraits(new ::boost::regex_traits_wrapper()), m_flags(0), m_status(0), m_expression(0), m_expression_len(0), + m_mark_count(0), m_first_state(0), m_restart_type(0), +#if !defined(BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX) && !(defined(BOOST_MSVC) && (BOOST_MSVC < 1900)) + m_startmap{ 0 }, +#endif + m_can_be_null(0), m_word_mask(0), m_has_recursions(false), m_disable_match_any(false) {} ::boost::shared_ptr< ::boost::regex_traits_wrapper diff --git a/include/boost/regex/v4/basic_regex_creator.hpp b/include/boost/regex/v4/basic_regex_creator.hpp index 7c0065273..5b866b2e4 100644 --- a/include/boost/regex/v4/basic_regex_creator.hpp +++ b/include/boost/regex/v4/basic_regex_creator.hpp @@ -267,7 +267,8 @@ class basic_regex_creator template basic_regex_creator::basic_regex_creator(regex_data* data) - : m_pdata(data), m_traits(*(data->m_ptraits)), m_last_state(0), m_repeater_id(0), m_has_backrefs(false), m_backrefs(0), m_has_recursions(false) + : m_pdata(data), m_traits(*(data->m_ptraits)), m_last_state(0), m_icase(false), m_repeater_id(0), + m_has_backrefs(false), m_backrefs(0), m_bad_repeats(0), m_has_recursions(false), m_word_mask(0), m_mask_space(0), m_lower_mask(0), m_upper_mask(0), m_alpha_mask(0) { m_pdata->m_data.clear(); m_pdata->m_status = ::boost::regex_constants::error_ok; @@ -1512,6 +1513,10 @@ void basic_regex_creator::probe_leading_repeat(re_syntax_base* st state = state->next.p; continue; } +#ifdef BOOST_MSVC +# pragma warning(push) +#pragma warning(disable:6011) +#endif if((static_cast(state)->index == -1) || (static_cast(state)->index == -2)) { @@ -1519,6 +1524,9 @@ void basic_regex_creator::probe_leading_repeat(re_syntax_base* st state = static_cast(state->next.p)->alt.p->next.p; continue; } +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif if(static_cast(state)->index == -3) { // Have to skip the leading jump state: diff --git a/include/boost/regex/v4/basic_regex_parser.hpp b/include/boost/regex/v4/basic_regex_parser.hpp index 85b43eafb..9cf2bad02 100644 --- a/include/boost/regex/v4/basic_regex_parser.hpp +++ b/include/boost/regex/v4/basic_regex_parser.hpp @@ -22,6 +22,9 @@ #ifdef BOOST_MSVC #pragma warning(push) #pragma warning(disable: 4103) +#if BOOST_MSVC >= 1800 +#pragma warning(disable: 26812) +#endif #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX @@ -124,7 +127,8 @@ class basic_regex_parser : public basic_regex_creator template basic_regex_parser::basic_regex_parser(regex_data* data) - : basic_regex_creator(data), m_mark_count(0), m_mark_reset(-1), m_max_mark(0), m_paren_start(0), m_alt_insert_point(0), m_has_case_change(false), m_recursion_count(0) + : basic_regex_creator(data), m_parser_proc(), m_base(0), m_end(0), m_position(0), + m_mark_count(0), m_mark_reset(-1), m_max_mark(0), m_paren_start(0), m_alt_insert_point(0), m_has_case_change(false), m_recursion_count(0) { } @@ -321,6 +325,12 @@ bool basic_regex_parser::parse_basic() return true; } +#ifdef BOOST_MSVC +# pragma warning(push) +#if BOOST_MSVC >= 1800 +#pragma warning(disable:26812) +#endif +#endif template bool basic_regex_parser::parse_extended() { @@ -409,6 +419,9 @@ bool basic_regex_parser::parse_extended() return result; } #ifdef BOOST_MSVC +# pragma warning(pop) +#endif +#ifdef BOOST_MSVC #pragma warning(pop) #endif @@ -911,8 +924,8 @@ bool basic_regex_parser::parse_extended_escape() pc = m_position; } if(negative) - i = 1 + m_mark_count - i; - if(((i > 0) && (i < std::numeric_limits::digits) && (i - 1 < static_cast(sizeof(unsigned) * CHAR_BIT)) && (this->m_backrefs & (1u << (i-1)))) || ((i > 10000) && (this->m_pdata->get_id(i) > 0) && (this->m_pdata->get_id(i)-1 < static_cast(sizeof(unsigned) * CHAR_BIT)) && (this->m_backrefs & (1u << (this->m_pdata->get_id(i)-1))))) + i = 1 + (static_cast(m_mark_count) - i); + if(((i > 0) && (i < std::numeric_limits::digits) && (i - 1 < static_cast(sizeof(unsigned) * CHAR_BIT)) && (this->m_backrefs & (1u << (i-1)))) || ((i > 10000) && (this->m_pdata->get_id(i) > 0) && (static_cast(this->m_pdata->get_id(i))-1 < static_cast(sizeof(unsigned) * CHAR_BIT)) && (this->m_backrefs & (1u << (this->m_pdata->get_id(i)-1))))) { m_position = pc; re_brace* pb = static_cast(this->append_state(syntax_element_backref, sizeof(re_brace))); @@ -2132,7 +2145,7 @@ bool basic_regex_parser::parse_perl_extension() // Oops not a relative recursion at all, but a (?-imsx) group: goto option_group_jump; } - v = m_mark_count + 1 - v; + v = static_cast(m_mark_count) + 1 - v; if(v <= 0) { // Rewind to start of (? sequence: @@ -2747,6 +2760,12 @@ bool basic_regex_parser::match_verb(const char* verb) return true; } +#ifdef BOOST_MSVC +# pragma warning(push) +#if BOOST_MSVC >= 1800 +#pragma warning(disable:26812) +#endif +#endif template bool basic_regex_parser::parse_perl_verb() { @@ -2915,6 +2934,9 @@ bool basic_regex_parser::parse_perl_verb() fail(regex_constants::error_perl_extension, m_position - m_base); return false; } +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif template bool basic_regex_parser::add_emacs_code(bool negate) diff --git a/include/boost/regex/v4/cpp_regex_traits.hpp b/include/boost/regex/v4/cpp_regex_traits.hpp index b7b32d8a5..847f2ed7e 100644 --- a/include/boost/regex/v4/cpp_regex_traits.hpp +++ b/include/boost/regex/v4/cpp_regex_traits.hpp @@ -174,7 +174,7 @@ template struct cpp_regex_traits_base { cpp_regex_traits_base(const std::locale& l) - { imbue(l); } + { (void)imbue(l); } std::locale imbue(const std::locale& l); std::locale m_locale; diff --git a/include/boost/regex/v4/match_flags.hpp b/include/boost/regex/v4/match_flags.hpp index aa8fd5326..1999ecf0b 100644 --- a/include/boost/regex/v4/match_flags.hpp +++ b/include/boost/regex/v4/match_flags.hpp @@ -28,6 +28,13 @@ namespace boost{ namespace regex_constants{ #endif +#ifdef BOOST_MSVC +#pragma warning(push) +#if BOOST_MSVC >= 1800 +#pragma warning(disable : 26812) +#endif +#endif + typedef enum _match_flags { match_default = 0, @@ -143,6 +150,11 @@ using regex_constants::format_no_copy; using regex_constants::format_first_only; /*using regex_constants::format_is_if;*/ +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + + } /* namespace boost */ #endif /* __cplusplus */ #endif /* include guard */ diff --git a/include/boost/regex/v4/match_results.hpp b/include/boost/regex/v4/match_results.hpp index d88a7b16b..7e5098012 100644 --- a/include/boost/regex/v4/match_results.hpp +++ b/include/boost/regex/v4/match_results.hpp @@ -95,7 +95,7 @@ class match_results // See https://svn.boost.org/trac/boost/ticket/3632. // match_results(const match_results& m) - : m_subs(m.m_subs), m_named_subs(m.m_named_subs), m_last_closed_paren(m.m_last_closed_paren), m_is_singular(m.m_is_singular) + : m_subs(m.m_subs), m_base(), m_null(), m_named_subs(m.m_named_subs), m_last_closed_paren(m.m_last_closed_paren), m_is_singular(m.m_is_singular) { if(!m_is_singular) { diff --git a/include/boost/regex/v4/perl_matcher.hpp b/include/boost/regex/v4/perl_matcher.hpp index 663e6188e..644e78bae 100644 --- a/include/boost/regex/v4/perl_matcher.hpp +++ b/include/boost/regex/v4/perl_matcher.hpp @@ -341,6 +341,12 @@ enum saved_state_type saved_state_count = 14 }; +#ifdef BOOST_MSVC +# pragma warning(push) +#if BOOST_MSVC >= 1800 +#pragma warning(disable:26495) +#endif +#endif template struct recursion_info { @@ -352,6 +358,9 @@ struct recursion_info repeater_count* repeater_stack; iterator location_of_start; }; +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif #ifdef BOOST_MSVC #pragma warning(push) @@ -578,6 +587,12 @@ class perl_matcher unsigned m_recursions; #endif +#ifdef BOOST_MSVC +# pragma warning(push) +#if BOOST_MSVC >= 1800 +#pragma warning(disable:26495) +#endif +#endif // these operations aren't allowed, so are declared private, // bodies are provided to keep explicit-instantiation requests happy: perl_matcher& operator=(const perl_matcher&) @@ -587,9 +602,8 @@ class perl_matcher perl_matcher(const perl_matcher& that) : m_result(that.m_result), re(that.re), traits_inst(that.traits_inst), rep_obj(0) {} }; - #ifdef BOOST_MSVC -#pragma warning(pop) +# pragma warning(pop) #endif } // namespace BOOST_REGEX_DETAIL_NS @@ -607,6 +621,9 @@ class perl_matcher } // namespace boost +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif #ifdef BOOST_MSVC # pragma warning(pop) #endif diff --git a/include/boost/regex/v4/perl_matcher_common.hpp b/include/boost/regex/v4/perl_matcher_common.hpp index 3c654e588..00edd63e4 100644 --- a/include/boost/regex/v4/perl_matcher_common.hpp +++ b/include/boost/regex/v4/perl_matcher_common.hpp @@ -23,6 +23,9 @@ #ifdef BOOST_MSVC #pragma warning(push) #pragma warning(disable: 4103) +#if BOOST_MSVC >= 1800 +#pragma warning(disable: 26812) +#endif #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX @@ -44,7 +47,11 @@ namespace boost{ namespace BOOST_REGEX_DETAIL_NS{ -template +#ifdef BOOST_MSVC +# pragma warning(push) +#pragma warning(disable:26812) +#endif + template void perl_matcher::construct_init(const basic_regex& e, match_flag_type f) { typedef typename regex_iterator_traits::iterator_category category; @@ -94,6 +101,9 @@ void perl_matcher::construct_init(const basic_r if(e.get_data().m_disable_match_any) m_match_flags &= regex_constants::match_not_any; } +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif template void perl_matcher::estimate_max_state_count(std::random_access_iterator_tag*) diff --git a/include/boost/regex/v4/regex_format.hpp b/include/boost/regex/v4/regex_format.hpp index b65ffcc9c..33c4a5cbe 100644 --- a/include/boost/regex/v4/regex_format.hpp +++ b/include/boost/regex/v4/regex_format.hpp @@ -90,6 +90,10 @@ struct trivial_format_traits } }; +#ifdef BOOST_MSVC +# pragma warning(push) +#pragma warning(disable:26812) +#endif template class basic_regex_formatter { @@ -203,6 +207,9 @@ class basic_regex_formatter basic_regex_formatter(const basic_regex_formatter&); basic_regex_formatter& operator=(const basic_regex_formatter&); }; +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif template OutputIterator basic_regex_formatter::format(ForwardIter p1, ForwardIter p2, match_flag_type f) diff --git a/include/boost/regex/v4/regex_token_iterator.hpp b/include/boost/regex/v4/regex_token_iterator.hpp index fde51d74e..ee8a0120a 100644 --- a/include/boost/regex/v4/regex_token_iterator.hpp +++ b/include/boost/regex/v4/regex_token_iterator.hpp @@ -67,16 +67,16 @@ class regex_token_iterator_implementation public: regex_token_iterator_implementation(const regex_type* p, BidirectionalIterator last, int sub, match_flag_type f) - : end(last), re(*p), flags(f){ subs.push_back(sub); } + : end(last), re(*p), flags(f), N(0){ subs.push_back(sub); } regex_token_iterator_implementation(const regex_type* p, BidirectionalIterator last, const std::vector& v, match_flag_type f) - : end(last), re(*p), flags(f), subs(v){} + : end(last), re(*p), flags(f), N(0), subs(v){} #if !BOOST_WORKAROUND(__HP_aCC, < 60700) #if (BOOST_WORKAROUND(__BORLANDC__, >= 0x560) && BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570)))\ || BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003)) \ || BOOST_WORKAROUND(__HP_aCC, < 60700) template regex_token_iterator_implementation(const regex_type* p, BidirectionalIterator last, const T& submatches, match_flag_type f) - : end(last), re(*p), flags(f) + : end(last), re(*p), flags(f), N(0) { // assert that T really is an array: BOOST_STATIC_ASSERT(::boost::is_array::value); @@ -89,7 +89,7 @@ class regex_token_iterator_implementation #else template regex_token_iterator_implementation(const regex_type* p, BidirectionalIterator last, const int (&submatches)[CN], match_flag_type f) - : end(last), re(*p), flags(f) + : end(last), re(*p), flags(f), N(0) { for(std::size_t i = 0; i < CN; ++i) { diff --git a/src/cregex.cpp b/src/cregex.cpp index a1ae3b087..ece28204e 100644 --- a/src/cregex.cpp +++ b/src/cregex.cpp @@ -70,6 +70,10 @@ inline std::string to_string(const char* i, const char* j) } namespace BOOST_REGEX_DETAIL_NS{ +#ifdef BOOST_MSVC +# pragma warning(push) +#pragma warning(disable:26812) +#endif class RegExData { public: @@ -103,6 +107,9 @@ class RegExData #endif strings(), positions() {} }; +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif void RegExData::update() { diff --git a/src/fileiter.cpp b/src/fileiter.cpp index c80459b86..a7a759a6b 100644 --- a/src/fileiter.cpp +++ b/src/fileiter.cpp @@ -112,16 +112,21 @@ void mapfile::open(const char* file) std::runtime_error err("Unable to create file mapping."); boost::BOOST_REGEX_DETAIL_NS::raise_runtime_error(err); } - _first = static_cast(MapViewOfFile(hmap, FILE_MAP_READ, 0, 0, 0)); - if(_first == 0) + else { - CloseHandle(hmap); - CloseHandle(hfile); - hmap = 0; - hfile = 0; - std::runtime_error err("Unable to create file mapping."); + _first = static_cast(MapViewOfFile(hmap, FILE_MAP_READ, 0, 0, 0)); + if (_first == 0) + { + CloseHandle(hmap); + CloseHandle(hfile); + hmap = 0; + hfile = 0; + std::runtime_error err("Unable to create file mapping."); + boost::BOOST_REGEX_DETAIL_NS::raise_runtime_error(err); + } + else + _last = _first + GetFileSize(hfile, 0); } - _last = _first + GetFileSize(hfile, 0); } else { diff --git a/src/posix_api.cpp b/src/posix_api.cpp index 1531d948a..47133fa02 100644 --- a/src/posix_api.cpp +++ b/src/posix_api.cpp @@ -66,6 +66,10 @@ const char* names[] = { typedef boost::basic_regex > c_regex_type; +#ifdef BOOST_MSVC +# pragma warning(push) +#pragma warning(disable:26812) +#endif BOOST_REGEX_DECL int BOOST_REGEX_CCALL regcompA(regex_tA* expression, const char* ptr, int f) { #ifndef BOOST_NO_EXCEPTIONS @@ -140,6 +144,9 @@ BOOST_REGEX_DECL int BOOST_REGEX_CCALL regcompA(regex_tA* expression, const char return result; } +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif BOOST_REGEX_DECL regsize_t BOOST_REGEX_CCALL regerrorA(int code, const regex_tA* e, char* buf, regsize_t buf_size) { diff --git a/src/regex.cpp b/src/regex.cpp index 5a8bbdc04..5cc43ae49 100644 --- a/src/regex.cpp +++ b/src/regex.cpp @@ -72,7 +72,7 @@ regex_error::regex_error(regex_constants::error_type err) { } -regex_error::~regex_error() throw() +regex_error::~regex_error() BOOST_NOEXCEPT { } diff --git a/src/wide_posix_api.cpp b/src/wide_posix_api.cpp index bc1c0af2a..c675104b1 100644 --- a/src/wide_posix_api.cpp +++ b/src/wide_posix_api.cpp @@ -76,6 +76,10 @@ const wchar_t* wnames[] = { typedef boost::basic_regex > wc_regex_type; +#ifdef BOOST_MSVC +# pragma warning(push) +#pragma warning(disable:26812) +#endif BOOST_REGEX_DECL int BOOST_REGEX_CCALL regcompW(regex_tW* expression, const wchar_t* ptr, int f) { #ifndef BOOST_NO_EXCEPTIONS @@ -150,6 +154,9 @@ BOOST_REGEX_DECL int BOOST_REGEX_CCALL regcompW(regex_tW* expression, const wcha return result; } +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif BOOST_REGEX_DECL regsize_t BOOST_REGEX_CCALL regerrorW(int code, const regex_tW* e, wchar_t* buf, regsize_t buf_size) { diff --git a/test/regress/info.hpp b/test/regress/info.hpp index 5c08961e2..beca8e5da 100644 --- a/test/regress/info.hpp +++ b/test/regress/info.hpp @@ -112,7 +112,7 @@ class test_info_base boost::call_once(f,&init_data); return do_get_data(); #else - static data_type d; + static data_type d = {}; return d; #endif } diff --git a/test/regress/test.hpp b/test/regress/test.hpp index d9224e8eb..e350990b8 100644 --- a/test/regress/test.hpp +++ b/test/regress/test.hpp @@ -99,7 +99,7 @@ void do_test(const charT& c, const tagT& tag) boost::call_once(f, proc); #endif if(test_locale::cpp_locale_state() == test_locale::test_with_locale) - e1.imbue(test_locale::cpp_locale()); + (void)e1.imbue(test_locale::cpp_locale()); if(test_locale::cpp_locale_state() != test_locale::no_test) test(e1, tag); #endif From f64c22870ffe00bff73936c16f6a533ddc885595 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Tue, 21 Jan 2020 10:14:37 +0000 Subject: [PATCH 2/2] Fix exception specification and msvc warning push/pop. --- include/boost/regex/pattern_except.hpp | 2 +- include/boost/regex/v4/perl_matcher.hpp | 31 ++++++++++--------------- src/regex.cpp | 2 +- 3 files changed, 14 insertions(+), 21 deletions(-) diff --git a/include/boost/regex/pattern_except.hpp b/include/boost/regex/pattern_except.hpp index e3d202e09..7ca409d8e 100644 --- a/include/boost/regex/pattern_except.hpp +++ b/include/boost/regex/pattern_except.hpp @@ -52,7 +52,7 @@ class BOOST_REGEX_DECL regex_error : public std::runtime_error public: explicit regex_error(const std::string& s, regex_constants::error_type err = regex_constants::error_unknown, std::ptrdiff_t pos = 0); explicit regex_error(regex_constants::error_type err); - ~regex_error() BOOST_NOEXCEPT; + ~regex_error() BOOST_NOEXCEPT_OR_NOTHROW; regex_constants::error_type code()const { return m_error_code; } std::ptrdiff_t position()const diff --git a/include/boost/regex/v4/perl_matcher.hpp b/include/boost/regex/v4/perl_matcher.hpp index 644e78bae..05886b089 100644 --- a/include/boost/regex/v4/perl_matcher.hpp +++ b/include/boost/regex/v4/perl_matcher.hpp @@ -27,6 +27,13 @@ #ifdef BOOST_MSVC # pragma warning(push) +#pragma warning(disable : 4251) +#if BOOST_MSVC < 1700 +# pragma warning(disable : 4231) +#endif +# if BOOST_MSVC < 1600 +# pragma warning(disable : 4660) +# endif #if BOOST_MSVC < 1910 #pragma warning(disable:4800) #endif @@ -362,17 +369,6 @@ struct recursion_info # pragma warning(pop) #endif -#ifdef BOOST_MSVC -#pragma warning(push) -#pragma warning(disable : 4251) -#if BOOST_MSVC < 1700 -# pragma warning(disable : 4231) -#endif -# if BOOST_MSVC < 1600 -# pragma warning(disable : 4660) -# endif -#endif - template class perl_matcher { @@ -601,13 +597,17 @@ class perl_matcher } perl_matcher(const perl_matcher& that) : m_result(that.m_result), re(that.re), traits_inst(that.traits_inst), rep_obj(0) {} -}; #ifdef BOOST_MSVC # pragma warning(pop) #endif +}; } // namespace BOOST_REGEX_DETAIL_NS +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif + #ifdef BOOST_MSVC #pragma warning(push) #pragma warning(disable: 4103) @@ -621,13 +621,6 @@ class perl_matcher } // namespace boost -#ifdef BOOST_MSVC -# pragma warning(pop) -#endif -#ifdef BOOST_MSVC -# pragma warning(pop) -#endif - // // include the implementation of perl_matcher: // diff --git a/src/regex.cpp b/src/regex.cpp index 5cc43ae49..ee0204cc4 100644 --- a/src/regex.cpp +++ b/src/regex.cpp @@ -72,7 +72,7 @@ regex_error::regex_error(regex_constants::error_type err) { } -regex_error::~regex_error() BOOST_NOEXCEPT +regex_error::~regex_error() BOOST_NOEXCEPT_OR_NOTHROW { }