diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-02-09 07:26:29 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-02-09 07:26:29 +0000 |
commit | e6565625f456123ad6eb33c84c8100d8f9411192 (patch) | |
tree | 19e5b6249c83e2f1f50c3181178c0dc4b9558ab0 /clang/test/Sema/incomplete-decl.c | |
parent | 78360a8184b5e8ffd60b6bc1a51aea2af9c95fc8 (diff) | |
download | bcm5719-llvm-e6565625f456123ad6eb33c84c8100d8f9411192.tar.gz bcm5719-llvm-e6565625f456123ad6eb33c84c8100d8f9411192.zip |
Migrate the mish-mash of declaration checks in
Sema::ActOnUninitializedDecl over to InitializationSequence (with
default initialization), eliminating redundancy. More importantly, we
now check that a const definition in C++ has an initilizer, which was
an #if 0'd code for many, many months. A few other tweaks were needed
to get everything working again:
- Fix all of the places in the testsuite where we defined const
objects without initializers (now that we diagnose this issue)
- Teach instantiation of static data members to find the previous
declaration, so that we build proper redeclaration
chains. Previously, we had the redeclaration chain but built it
too late to be useful, because...
- Teach instantiation of static data member definitions not to try
to check an initializer if a previous declaration already had an
initializer. This makes sure that we don't complain about static
const data members with in-class initializers and out-of-line
definitions.
- Move all of the incomplete-type checking logic out of
Sema::FinalizeDeclaratorGroup; it makes more sense in
ActOnUnitializedDecl.
There may still be a few places where we can improve these
diagnostics. I'll address that as a separate commit.
llvm-svn: 95657
Diffstat (limited to 'clang/test/Sema/incomplete-decl.c')
-rw-r--r-- | clang/test/Sema/incomplete-decl.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/test/Sema/incomplete-decl.c b/clang/test/Sema/incomplete-decl.c index 753d9c0a3c1..e5b6d5f0da6 100644 --- a/clang/test/Sema/incomplete-decl.c +++ b/clang/test/Sema/incomplete-decl.c @@ -16,7 +16,7 @@ int ary[]; // expected-warning {{tentative array definition assumed to have one struct foo bary[]; // expected-error {{array has incomplete element type 'struct foo'}} void func() { - int ary[]; // expected-error{{variable has incomplete type 'int []'}} + int ary[]; // expected-error{{definition of variable with array type needs an explicit size or an initializer}} void b; // expected-error {{variable has incomplete type 'void'}} struct foo f; // expected-error {{variable has incomplete type 'struct foo'}} } |