[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lmi] gcc-3.3 error?
From: |
Greg Chicares |
Subject: |
Re: [lmi] gcc-3.3 error? |
Date: |
Tue, 01 Nov 2005 20:22:55 +0000 |
User-agent: |
Mozilla Thunderbird 1.0.2 (Windows/20050317) |
On 2005-11-1 18:31 UTC, Vadim Zeitlin wrote:
> On Tue, 01 Nov 2005 16:44:27 +0000 Greg Chicares <address@hidden> wrote:
[snip interesting analysis]
> GC> But first I'd like to understand the problem; do you see any reason why
> GC> this should not be legal?
>
> I don't, I think it's a compiler bug. It seems to misparse the line 18 as
> a function declaration (hypothesis confirmed by the fact that it's enough
> to take e_type(e_val) in an additional pair of brackets to make the error
> disappear --
Thank you very much. I had hypothesized that this might involve what
Scott Meyers call C++'s "most vexing parse", as you have confirmed.
> however I think such fix would be less clear than what I did).
Agreed. I do find this workaround in one lmi file:
FundAllocs = std::vector<r_fund>
((std::istream_iterator<r_fund>(iss))
,std::istream_iterator<r_fund>()
);
and I don't think I'll bother to change that one because it's such
a common problem in the istream_iterator case that experienced C++
programmers would probably recognize it, and it's in a messy piece
of code that's ifdef'd out anyway. But in general it's better to
separate it into two lines, as you did; I'll probably add a comment
there to guard against anyone recombining the lines later.
> GC> Similar constructs might be used elsewhere, perhaps in code you aren't
> GC> building; if so, I'd like to consider fixing them all.
>
> This doesn't contradict at all what you say here but if you do find some
> file which I don't build, please let me know so that I could fix it.
I'm quite sure I used to do similar things elsewhere, which is why
I speculated that there might be some files you don't build. But I
can't find any similar usage now, so probably I already fixed any
other problems of this sort.