[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

Neil Booth neil at daikokuya.co.uk
Fri Jan 18 16:44:40 PST 2008


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 I'm aware of, so must be
accepted.

/tmp/bug.c:1:12: error: variable has incomplete type 'struct foo'
struct foo x;
           ^
1 diagnostic generated.

Neil.



More information about the cfe-commits mailing list