diff --git a/include/boost/regex/v4/basic_regex_creator.hpp b/include/boost/regex/v4/basic_regex_creator.hpp index f5e3d0f0..89767569 100644 --- a/include/boost/regex/v4/basic_regex_creator.hpp +++ b/include/boost/regex/v4/basic_regex_creator.hpp @@ -403,10 +403,20 @@ re_syntax_base* basic_regex_creator::append_set( if(flags() & regex_constants::collate) { // we need to transform our range into sort keys: +#if BOOST_WORKAROUND(__GNUC__, < 3) + string_type in(3, charT(0)); + in[0] = c1.first; + in[1] = c1.second; + s1 = this->m_traits.transform(in.c_str(), (in[1] ? in.c_str()+2 : in.c_str()+1)); + in[0] = c2.first; + in[1] = c2.second; + s2 = this->m_traits.transform(in.c_str(), (in[1] ? in.c_str()+2 : in.c_str()+1)); +#else charT a1[3] = { c1.first, c1.second, charT(0), }; charT a2[3] = { c2.first, c2.second, charT(0), }; s1 = this->m_traits.transform(a1, (a1[1] ? a1+2 : a1+1)); s2 = this->m_traits.transform(a2, (a2[1] ? a2+2 : a2+1)); +#endif if(s1.size() == 0) s1 = string_type(1, charT(0)); if(s2.size() == 0) @@ -451,8 +461,15 @@ re_syntax_base* basic_regex_creator::append_set( string_type s; if(first->second) { +#if BOOST_WORKAROUND(__GNUC__, < 3) + string_type in(3, charT(0)); + in[0] = first->first; + in[1] = first->second; + s = m_traits.transform_primary(in.c_str(), in.c_str()+2); +#else charT cs[3] = { first->first, first->second, charT(0), }; s = m_traits.transform_primary(cs, cs+2); +#endif } else s = m_traits.transform_primary(&first->first, &first->first+1); diff --git a/include/boost/regex/v4/protected_call.hpp b/include/boost/regex/v4/protected_call.hpp index d8b597f5..197c4556 100644 --- a/include/boost/regex/v4/protected_call.hpp +++ b/include/boost/regex/v4/protected_call.hpp @@ -31,6 +31,8 @@ class BOOST_REGEX_DECL abstract_protected_call { public: bool BOOST_REGEX_CALL execute()const; + // this stops gcc-4 from complaining: + virtual ~abstract_protected_call(){} private: virtual bool call()const = 0; };