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 | a4ed0d8d75212dc01b4438829a4b0c846d99458d (patch) | |
tree | f72d8fcea1a6e4db4a415065d4e7d0eff5e96c96 /test/Sema/decl-invalid.c | |
parent | 3c902ced87cd3e9994116485d7f28ca7f58b68e7 (diff) |
Diagnose declarations that don't declare anything, and fix PR3020.
Examples:
int;
typedef int;
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61454 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/decl-invalid.c')
-rw-r--r-- | test/Sema/decl-invalid.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/test/Sema/decl-invalid.c b/test/Sema/decl-invalid.c index 767d6e6ab4..78a9ee1d4b 100644 --- a/test/Sema/decl-invalid.c +++ b/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}} |