This is the mail archive of the
mailing list for the GCC project.
Re: PR c++/26997 g++ reports misleading error message when the identifier with error occurs earlier on the same line
Manuel López-Ibáñez wrote:
> 2008/10/28 Mark Mitchell <firstname.lastname@example.org>:
>> (X) ; // Not a cast.
>> (X) 3 ... // A cast.
> What about ?
> We currently parse the above as casts. Is that correct?
I believe so, yes.
> If I understand correctly (C()) followed by comma, semicolon, period,
> '->' or unambiguous binary operator must be a call to constructor,
> anything else must be a cast. Am I right?
I think that's correct, with the exception of the statement-expression
case already handled by the parser. I hesitate to make absolute
statements about these things because there are so many corner cases,
but I can't think of an example where your rule is incorrect. As a
first cut, you could try implementing it and running the testsuite.
(650) 331-3385 x713