[cfe-commits] r68911 - in /cfe/trunk: include/clang/Basic/DiagnosticParseKinds.td lib/Parse/ParseDecl.cpp test/Lexer/block_cmt_end.c test/Parser/declarators.c test/Parser/objc-foreach-syntax.m test/SemaObjC/exception-go-boom.m
Sebastian Redl
sebastian.redl at getdesigned.at
Sun Apr 12 14:40:46 PDT 2009
Chris Lattner wrote:
> Author: lattner
> Date: Sun Apr 12 15:42:31 2009
> New Revision: 68911
>
> URL: http://llvm.org/viewvc/llvm-project?rev=68911&view=rev
> Log:
> Implement the first set of changes for PR3963 and rdar://6759604,
> which tries to do better error recovery when it is "obvious" that an
> identifier is a mis-typed typename.
Very, very cool. I think you have to work with MSVC's awful error
recovery to *really* appreciate how nice this is.
> I'd really appreciate any scrutiny possible on this, it
> is a tricky area.
>
>
Looks pretty solid to me. One comment below.
> +/// isValidAfterIdentifierInDeclaratorAfterDeclSpec - Return true if the
> +/// specified token is valid after the identifier in a declarator which
> +/// immediately follows the declspec. For example, these things are valid:
> +///
> +/// int x [ 4]; // direct-declarator
> +/// int x ( int y); // direct-declarator
> +/// int(int x ) // direct-declarator
> +/// int x ; // simple-declaration
> +/// int x = 17; // init-declarator-list
> +/// int x , y; // init-declarator-list
> +/// int x __asm__ ("foo"); // init-declarator-list
> +///
>
We don't parse it yet, but in C++0x there's the unified initialization
syntax, which makes this valid:
int x {5};
which is equivalent to
int x = {5};
and
int x(5);
(Yay for redundancy.)
Sebastian
More information about the cfe-commits
mailing list