Boost logo

Boost :

Subject: Re: [boost] [xpressive] Compiler error on VC7.1
From: Eric Niebler (eric_at_[hidden])
Date: 2012-05-11 14:51:31


I just tried the below code on VC++ 2003 (7.1) and was unable to
reproduce your error. (I assume _serverName is of type sregex?) I'm
afraid I don't know what to tell you. Perhaps if you could give me a
complete repro scenario, I might be able to help.

On 5/11/2012 9:56 AM, Robert Dailey wrote:
> Anyone have an idea on this issue? It's currently blocking me from checking
> in this code to source control, since the code absolutely must work on MSVC
> 7.1 :-(
>
> On Thu, May 10, 2012 at 4:45 PM, Robert Dailey <rcdailey.lists_at_[hidden]>wrote:
>
>> Hi,
>>
>> I'm using Boost 1.49 Xpressive on VC7.1. When I compile the following
>> code, I get compiler errors (these do not appear on VC9):
>>
>> sregex const& rex = bos >> _serverName >> !as_xpr("_GWDomino") >>
>> ".diagnostics" >> *(as_xpr(".base")|".renamed");
>>
>> 'rex' is really a function parameter in my real world use case. I'm
>> passing the entire static regex into a function that takes a 'sregex
>> const&'. I get the compiler error below. Anyone know why this is happening?
>>
>>
>> C:\Code\work\cmake-decomp\build-vc7\third_party\boost\1.49.0-stlport-5.2.1\include\boost\proto\traits.hpp(691)
>> : error C2664: 'boost::proto::exprns_::expr<Tag,Args,Arity>::expr(const
>> boost::proto::exprns_::expr<Tag,Args,Arity> &)' : cannot convert parameter
>> 1 from
>> 'boost::proto::detail::as_expr<T,Generator,WantsBasicExpr>::result_type' to
>> 'const boost::proto::exprns_::expr<Tag,Args,Arity> &'
>> with
>> [
>> Tag=boost::proto::tagns_::tag::terminal,
>>
>> Args=boost::proto::argsns_::term<boost::proto::detail::as_expr<const char
>> [10],boost::proto::detail::base_generator<boost::proto::default_generator>::type,false>::value_type>,
>> Arity=0
>> ]
>> and
>> [
>> T=const char [10],
>>
>> Generator=boost::proto::detail::base_generator<boost::proto::default_generator>::type,
>> WantsBasicExpr=false
>> ]
>> and
>> [
>> Tag=boost::proto::tagns_::tag::terminal,
>>
>> Args=boost::proto::argsns_::term<boost::proto::detail::as_expr<const char
>> [10],boost::proto::detail::base_generator<boost::proto::default_generator>::type,false>::value_type>,
>> Arity=0
>> ]
>> Reason: cannot convert from
>> 'boost::proto::detail::as_expr<T,Generator,WantsBasicExpr>::result_type' to
>> 'const boost::proto::exprns_::expr<Tag,Args,Arity>'
>> with
>> [
>> T=const char [10],
>>
>> Generator=boost::proto::detail::base_generator<boost::proto::default_generator>::type,
>> WantsBasicExpr=false
>> ]
>> and
>> [
>> Tag=boost::proto::tagns_::tag::terminal,
>>
>> Args=boost::proto::argsns_::term<boost::proto::detail::as_expr<const char
>> [10],boost::proto::detail::base_generator<boost::proto::default_generator>::type,false>::value_type>,
>> Arity=0
>> ]
>> No constructor could take the source type, or constructor overload
>> resolution was ambiguous
>>
>> \Code\work\cmake-decomp\server\exchange\tools\uploadlog\uploader.cpp(1372)
>> : see reference to function template instantiation 'const
>> boost::add_const<T>::type boost::proto::functional::as_expr<>::operator
>> ()<char,10>(const char (&)[10]) const' being compiled
>> with
>> [
>> T=boost::proto::detail::as_expr<const char
>> [10],boost::proto::detail::base_generator<boost::proto::default_generator>::type,false>::result_type
>> ]
>>
>
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
>

-- 
Eric Niebler
BoostPro Computing
http://www.boostpro.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk