[1.35.0][xpressive] INVALID_REGULAR_EXPRESSION - why?
Hi! The following piece of code used to compile with previous versions of boost: using namespace boost::xpressive; sregex path_delimiter = '/'; Now it bails out on VC8 SP1 with (beautified output): ------ Build started: Project: XXXX, Configuration: Release Win32 ------ Compiling... MainFrm.cpp MY_PATH_TO_BOOST\boost_1_35_0\boost/xpressive/proto/matches.hpp(356) : error C2825: 'Expr': must be a class or namespace when followed by '::' MY_PATH_TO_BOOST\boost_1_35_0\boost/xpressive/detail/static/grammar.hpp(317) : see reference to class template instantiation 'boost::proto::result_of::matches<Expr,Grammar>' being compiled with [ Expr=char, Grammar=boost::xpressive::Grammar<char> ] MY_PATH_TO_BOOST\boost_1_35_0\boost/mpl/if.hpp(63) : see reference to class template instantiation 'boost::xpressive::is_valid_regex<Expr,Char>' being compiled with [ Expr=char, Char=char ] MY_PATH_TO_BOOST\boost_1_35_0\boost/xpressive/basic_regex.hpp(94) : see reference to class template instantiation 'boost::mpl::if_<T1,T2,T3>' being compiled with [ T1=boost::xpressive::is_valid_regex<char,char>, T2=boost::mpl::true_, T3=boost::xpressive::INVALID_REGULAR_EXPRESSION ] .\MainFrm.cpp(1514) : see reference to function template instantiation 'boost::xpressive::basic_regex<BidiIter>::basic_regex<char>(const Expr &)' being compiled with [ BidiIter=std::_String_const_iterator<char,std::char_traits<char>, std::allocator<char>>, Expr=char ] MY_PATH_TO_BOOST\boost_1_35_0\boost/xpressive/proto/matches.hpp(356) : error C2143: syntax error : missing ',' before '`global namespace'::proto_base_expr' MY_PATH_TO_BOOST\boost_1_35_0\boost/xpressive/proto/matches.hpp(356) : error C2977: 'boost::proto::detail::matches_impl' : too many template arguments MY_PATH_TO_BOOST\boost_1_35_0\boost/xpressive/proto/matches.hpp(260) : see declaration of 'boost::proto::detail::matches_impl' MY_PATH_TO_BOOST\boost_1_35_0\boost/xpressive/proto/matches.hpp(357) : error C2955: 'boost::proto::detail::matches_impl' : use of class template requires template argument list MY_PATH_TO_BOOST\boost_1_35_0\boost/xpressive/proto/matches.hpp(260) : see declaration of 'boost::proto::detail::matches_impl' MY_PATH_TO_BOOST\boost_1_35_0\boost/xpressive/basic_regex.hpp(94) : error C2664: 'boost::mpl::assertion_failed' : cannot convert parameter 1 from 'boost::mpl::failed ************boost::xpressive::INVALID_REGULAR_EXPRESSION::* ***********' to 'boost::mpl::assert<false>::type' No constructor could take the source type, or constructor overload resolution was ambiguous MY_PATH_TO_BOOST\boost_1_35_0\boost/xpressive/basic_regex.hpp(95) : error C2514: 'boost::xpressive::is_valid_regex<Expr,Char>' : class has no constructors with [ Expr=char, Char=char ] Build What went wrong? Changing the code to sregex path_delimiter = sregex::compile("/"); fixes the issue for me, but I missed this change in the release notes ... Markus
Markus Werle wrote:
Hi!
The following piece of code used to compile with previous versions of boost:
using namespace boost::xpressive; sregex path_delimiter = '/';
Now it bails out on VC8 SP1 with (beautified output):
<snip>
What went wrong?
Changing the code to sregex path_delimiter = sregex::compile("/");
fixes the issue for me, but I missed this change in the release notes ...
There is an ambiguity here: // What does this do? sregex rx = '$'; You may have meant: // Zero-width match at the end of the line sregex rx = sregex::compile("$"); Or you may have meant: // Match a literal '$' character sregex rx = as_xpr('$'); Rather than guess what you mean, it's now an error and you have to say which. I simply forgot I made this change, which is why it's not in the release notes. -- Eric Niebler Boost Consulting www.boost-consulting.com
Eric Niebler <eric <at> boost-consulting.com> writes:
Or you may have meant:
// Match a literal '$' character sregex rx = as_xpr('$');
Rather than guess what you mean, it's now an error and you have to say which. I simply forgot I made this change, which is why it's not in the release notes.
So if I simply wnat to use "/" as separator for tokenisation I have to say as_xpr here, right? Markus
participants (2)
-
Eric Niebler
-
Markus Werle