[cfe-commits] r68919 - in /cfe/trunk: lib/Parse/ParseDecl.cpp test/Parser/cxx-decl.cpp test/SemaCXX/nested-name-spec.cpp

Chris Lattner sabre at nondot.org
Sun Apr 12 15:33:49 PDT 2009


On Apr 12, 2009, at 3:29 PM, Sebastian Redl wrote:
>> We now only emit:
>>
>> t2.cc:1:7: warning: type specifier missing, defaults to 'int'
>> int x(*g);
>>      ^
>>
> Aside from the parenthesis errors gone, this feels like a regression.
> The line looks like a declaration of an integer 'x', initialized with
> the result of dereferencing the (sadly non-existent) pointer 'g'. It
> doesn't strike me as a function declaration.

I'm sorry, I pasted the wrong diag.  I was trying C and C++ and  
grabbed the right one.  C++ doesn't have implicit int so this would be  
a really really bad diagnostic to produce.  The right one is:

t.cc:1:8: error: use of undeclared identifier 'g'
int x(*g);
        ^

> The real question is, why does it complain about the missing  
> parenthesis?

The call to SkipUntil ate the ')' and the parser logic expected it to  
be there.

-Chris



More information about the cfe-commits mailing list