diff options
author | Sebastian Redl <sebastian.redl@getdesigned.at> | 2008-12-28 15:28:59 +0000 |
---|---|---|
committer | Sebastian Redl <sebastian.redl@getdesigned.at> | 2008-12-28 15:28:59 +0000 |
commit | a2b5e31cb19f4fd4680e7230cd5497f5ef09a438 (patch) | |
tree | 6fd57f409f89d403fd1223128378c58cf61cbd3c /clang/test/Sema/decl-invalid.c | |
parent | 85cd7bac29a05dbab8b784eec5585ae1aa9564d7 (diff) | |
download | bcm5719-llvm-a2b5e31cb19f4fd4680e7230cd5497f5ef09a438.tar.gz bcm5719-llvm-a2b5e31cb19f4fd4680e7230cd5497f5ef09a438.zip |
Diagnose declarations that don't declare anything, and fix PR3020.
Examples:
int;
typedef int;
llvm-svn: 61454
Diffstat (limited to 'clang/test/Sema/decl-invalid.c')
-rw-r--r-- | clang/test/Sema/decl-invalid.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/clang/test/Sema/decl-invalid.c b/clang/test/Sema/decl-invalid.c index 767d6e6ab40..78a9ee1d4bf 100644 --- a/clang/test/Sema/decl-invalid.c +++ b/clang/test/Sema/decl-invalid.c @@ -1,6 +1,7 @@ // RUN: clang %s -fsyntax-only -verify -typedef union <anonymous> __mbstate_t; // expected-error {{declaration of anonymous union must be a definition}} +// See Sema::ParsedFreeStandingDeclSpec about the double diagnostic +typedef union <anonymous> __mbstate_t; // expected-error {{declaration of anonymous union must be a definition}} expected-error {{declaration does not declare anything}} // PR2017 @@ -9,3 +10,9 @@ int a() { int r[x()]; // expected-error {{size of array has non-integer type 'void'}} } +int; // expected-error {{declaration does not declare anything}} +typedef int; // expected-error {{declaration does not declare anything}} +const int; // expected-error {{declaration does not declare anything}} +struct; // expected-error {{declaration of anonymous struct must be a definition}} // expected-error {{declaration does not declare anything}} +typedef int I; +I; // expected-error {{declaration does not declare anything}} |