[cfe-commits] r68914 - in /cfe/trunk: include/clang/Basic/DiagnosticParseKinds.td include/clang/Parse/Action.h include/clang/Parse/Parser.h lib/Parse/ParseDecl.cpp lib/Parse/ParseDeclCXX.cpp lib/Sema/Sema.h lib/Sema/SemaDecl.cpp test/Parser/declarators.c

Douglas Gregor dgregor at apple.com
Sun Apr 12 20:25:35 PDT 2009


On Apr 12, 2009, at 2:49 PM, Chris Lattner wrote:

> Author: lattner
> Date: Sun Apr 12 16:49:30 2009
> New Revision: 68914
>
> URL: http://llvm.org/viewvc/llvm-project?rev=68914&view=rev
> Log:
> Diagnose invalid uses of tagged types with a missing tag.  For  
> example, in:
>
> struct xyz { int y; };
> enum abc { ZZZ };
>
> static xyz b;
> abc c;
>
> we used to produce:
>
> t2.c:4:8: error: unknown type name 'xyz'
> static xyz b;
>       ^
> t2.c:5:1: error: unknown type name 'abc'
> abc c;
> ^
>
> we now produce:
>
> t2.c:4:8: error: use of tagged type 'xyz' without 'struct' tag
> static xyz b;
>       ^
>       struct
> t2.c:5:1: error: use of tagged type 'abc' without 'enum' tag
> abc c;
> ^
> enum

This is *excellent*! I especially like the fix-it hint.

	- Doug



More information about the cfe-commits mailing list