diff options
Diffstat (limited to 'test/Sema/decl-invalid.c')
-rw-r--r-- | test/Sema/decl-invalid.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/Sema/decl-invalid.c b/test/Sema/decl-invalid.c new file mode 100644 index 000000000000..051f0f7ffbcc --- /dev/null +++ b/test/Sema/decl-invalid.c @@ -0,0 +1,29 @@ +// RUN: clang-cc %s -fsyntax-only -verify + +// 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 +void x(); +int a() { + int r[x()]; // expected-error {{size of array has non-integer type 'void'}} + + static y ?; // expected-error{{unknown type name 'y'}} \ + expected-error{{expected identifier or '('}} \ + expected-error{{expected ';' at end of declaration}} +} + +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}} + + + +// rdar://6880449 +register int test1; // expected-error {{illegal storage class on file-scoped variable}} +register int test2 __asm__("edi"); // expected-error {{global register variables are not supported}} + |