Boost logo

Boost :

Subject: Re: [boost] [xpressive] Compiler error on VC7.1
From: Robert Dailey (rcdailey.lists_at_[hidden])
Date: 2012-06-26 12:15:40


On Tue, May 22, 2012 at 7:02 PM, Eric Niebler <eric_at_[hidden]> wrote:

> On 5/22/2012 12:14 PM, Jeffrey Lee Hellrung, Jr. wrote:
> > On Tue, May 22, 2012 at 11:50 AM, Robert Dailey <
> rcdailey.lists_at_[hidden]>wrote:
> >
> >> On Tue, May 22, 2012 at 12:47 PM, Jeffrey Lee Hellrung, Jr. <
> >> jeffrey.hellrung_at_[hidden]> wrote:
> >>
> >>> On Tue, May 22, 2012 at 9:18 AM, Robert Dailey <
> rcdailey.lists_at_[hidden]
> >>>> wrote:
> >>>
> >>>> I provided a sample to reproduce this issue. Has anyone had a chance
> to
> >>> try
> >>>> it? I'm still blocked and can't build....
> >>>>
> >>>> On Mon, May 14, 2012 at 4:53 PM, Robert Dailey <
> >> rcdailey.lists_at_[hidden]
> >>>>> wrote:
> >>>>
> >>>>> Here is a small sample that reproduces the issue. Compile this using
> >>>>> Visual Studio .NET 2003 and use Boost v1.49
> >>>>
> >>> [...]
> >>>
> >>> I'm not familiar with xpressive nor do I have access to VS 2003.
> Indeed,
> >>> you might be hard pressed to find support for VS 2003...? Have you
> tried
> >>> the same code on a more recent version of VS and/or on another compiler
> >>> series (gcc, intel, clang, ...)?
> >>
> >>
> >> I mentioned earlier that the same code works just fine on Visual Studio
> >> 2008. However, Boost is supposed to be portable, I think this also
> applies
> >> to older compilers. We don't all have the luxury of working on the
> latest &
> >> greatest. I was hoping the author would look at this, maybe fix any
> issues,
> >> and provide a patch. I've tried debugging this issue myself but I just
> >> don't understand boost's internals.
> >>
> >
> > Older compilers may have bugs; older versions of VS especially have
> quite a
> > few bugs that sometimes don't crop up except in very specific and
> > unpredictable acrobatic template contexts. Boost does its best to work
> > around them but it's obviously difficult to account for all compiler
> > deficiencies. And I'm not suggesting that you must transition to the
> latest
> > and greatest, but I might suggest later and greater :)
> >
> > It looks like Eric tried an original version of the code and had no
> > problems, and he *did* offer that he might be able to help if you
> include a
> > "complete repro scenario" (which I've unfortunately snipped...oops).
> > So...hopefully he or someone else will get around to looking at it. You
> > might get more attention if you create a trac ticket, attach the code to
> > it, and reference the ticket in a mailing list message.
>
> Apologies for the delay, I was at BoostCon. I was able to reproduce the
> error, but not fix it I'm afraid. A smaller repro is:
>
> #include <boost/proto/core.hpp>
> int main() {
> boost::proto::as_expr<boost::proto::default_domain>("abcd");
> }
>
> This used to work on VC7.1 but stopped working many Boost releases ago
> due to a major refactorization in Proto. I spent a few hours trying to
> work around the problem, but the work-around eluded me. Note that the
> following actually compiles:
>
> boost::proto::as_expr("abcd");
>
> This is exactly identical to the above. (When you don't specify a
> domain, it defaults to default_domain.) For whatever reason, it's
> different enough to cause the problem. The older VC releases are like
> that. :-(
>
> VC7.1 hasn't been part of the Boost test matrix in eons. There's no
> reasonable way to keep it working while preserving my sanity, so I'm
> dropping support for it in Proto and xpressive. Sorry. If you simply
> must stick with VC7.1, I suggest reverting to Boost 1.43. It should work
> there.

Hey sorry for the late response, I haven't had a chance to work on this for
a while. I'm finally back on it. I am using Boost 1.43 as you instructed
but I still get a compiler failure:

C:\Code\work\cmake\dpd-cmake-sandbox\build-vc71\third_party\boost\1.43.0\include\boost\proto\expr.hpp(96)
: error C2166: l-value specifies const object
C:\Code\work\cmake\dpd-cmake-sandbox\build-vc71\third_party\boost\1.43.0\include\boost\proto\expr.hpp(93)
: error C2512: 'boost::proto::exprns_::expr<Tag,Args,Arity>' : no
appropriate default constructor available
        with
        [
            Tag=boost::proto::tag::terminal,
            Args=boost::proto::argsns_::term<const
boost::proto::result_of::as_expr<const char
[6],boost::proto::domainns_::default_domain,void,void>::arg0_>,
            Arity=0
        ]

C:\Code\work\cmake\dpd-cmake-sandbox\build-vc71\third_party\boost\1.43.0\include\boost\proto\detail\expr0.hpp(96)
: see reference to function template instantiation
'boost::proto::exprns_::expr<Tag,Args,Arity>
boost::proto::detail::make_terminal<T,boost::proto::tag::terminal,const
char,6>(const T (&)[6],boost::proto::exprns_::expr<Tag,Args,Arity> *)'
being compiled
        with
        [
            Tag=boost::proto::tag::terminal,
            Args=boost::proto::argsns_::term<const
boost::proto::result_of::as_expr<const char
[6],boost::proto::domainns_::default_domain,void,void>::arg0_>,
            Arity=0,
            T=char
        ]

C:\Code\work\cmake\dpd-cmake-sandbox\build-vc71\third_party\boost\1.43.0\include\boost\proto\traits.hpp(267)
: see reference to function template instantiation 'const
boost::proto::exprns_::expr<Tag,Args,Arity>
boost::proto::exprns_::expr<Tag,Args,Arity>::make<const T[6]>(A0 (&))'
being compiled
        with
        [
            Tag=boost::proto::tag::terminal,
            Args=boost::proto::argsns_::term<const
boost::proto::result_of::as_expr<const char
[6],boost::proto::domainns_::default_domain,void,void>::arg0_>,
            Arity=0,
            T=char,
            A0=const char [6]
        ]

C:\Code\work\cmake\dpd-cmake-sandbox\build-vc71\third_party\boost\1.43.0\include\boost\proto\traits.hpp(839)
: see reference to function template instantiation 'const
boost::proto::result_of::as_expr<T,Domain,Void,Void2>::reference
boost::proto::result_of::as_expr<T,Domain,Void,Void2>::call<const char[
6]>(T2 (&))' being compiled
        with
        [
            T=const char [6],
            Domain=boost::proto::domainns_::default_domain,
            Void=void,
            Void2=void,
            T2=const char [6]
        ]

\Code\work\cmake\dpd-cmake-sandbox\server\exchange\tools\uploadlog\uploader.cpp(1413)
: see reference to function template instantiation 'const
boost::proto::result_of::as_expr<T,Domain,Void,Void2>::reference
boost::proto::functional::as_expr<>::operator ()<char,6>(const char (&)[6])
const' being compiled
        with
        [
            T=const char [6],
            Domain=boost::proto::domainns_::default_domain,
            Void=void,
            Void2=void


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