[cfe-commits] r46152 - in /cfe/trunk: Sema/SemaDecl.cpp test/Sema/array-constraint.c test/Sema/deref.c test/Sema/enum.c test/Sema/incomplete-decl.c

Mike Stump mrs at apple.com
Sat Jan 19 11:37:31 PST 2008

On Jan 18, 2008, at 4:44 PM, Neil Booth wrote:
> Steve Naroff wrote:-
>> +struct foo f; // expected-error {{variable has incomplete type  
>> 'struct foo'}}
> Why do you think there is something inherently wrong with this?  In
> general you have to wait until the end of the TU.

> struct foo x;
> struct foo { int x; };
> does not violate any rule in the standard

6 A  program  is  ill-formed  if  the definition of any object gives the
   object an incomplete type (_basic.types_).

but that's for C++, so a check for complete type in C++ would be  
fine.  :-)

More information about the cfe-commits mailing list