This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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 <mark@codesourcery.com>:
>>  (X) ; // Not a cast.
>>  (X) 3 ... // A cast.
> 
> What about ?
> (C())*var;
> 
>  or
> 
> (C())+var;
> 
> 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.

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]