Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 %s -fsyntax-only -verify |
Chris Lattner | e80a59c | 2007-07-25 00:24:17 +0000 | [diff] [blame] | 2 | |
Sebastian Redl | a4ed0d8 | 2008-12-28 15:28:59 +0000 | [diff] [blame] | 3 | // See Sema::ParsedFreeStandingDeclSpec about the double diagnostic |
Douglas Gregor | cb821d0 | 2010-04-08 21:33:23 +0000 | [diff] [blame] | 4 | typedef union <anonymous> __mbstate_t; // expected-error {{declaration of anonymous union must be a definition}} expected-warning {{declaration does not declare anything}} |
Chris Lattner | fd89bc8 | 2008-04-02 01:05:10 +0000 | [diff] [blame] | 5 | |
| 6 | |
| 7 | // PR2017 |
| 8 | void x(); |
| 9 | int a() { |
Chris Lattner | 0947b4e | 2008-11-24 01:28:17 +0000 | [diff] [blame] | 10 | int r[x()]; // expected-error {{size of array has non-integer type 'void'}} |
Chris Lattner | 5186872 | 2009-04-12 20:51:10 +0000 | [diff] [blame] | 11 | |
| 12 | static y ?; // expected-error{{unknown type name 'y'}} \ |
John McCall | d8ac057 | 2009-11-03 19:26:08 +0000 | [diff] [blame] | 13 | expected-error{{expected identifier or '('}} |
Chris Lattner | fd89bc8 | 2008-04-02 01:05:10 +0000 | [diff] [blame] | 14 | } |
| 15 | |
Douglas Gregor | cb821d0 | 2010-04-08 21:33:23 +0000 | [diff] [blame] | 16 | int; // expected-warning {{declaration does not declare anything}} |
| 17 | typedef int; // expected-warning {{declaration does not declare anything}} |
| 18 | const int; // expected-warning {{declaration does not declare anything}} |
| 19 | struct; // expected-error {{declaration of anonymous struct must be a definition}} // expected-warning {{declaration does not declare anything}} |
Sebastian Redl | a4ed0d8 | 2008-12-28 15:28:59 +0000 | [diff] [blame] | 20 | typedef int I; |
Douglas Gregor | cb821d0 | 2010-04-08 21:33:23 +0000 | [diff] [blame] | 21 | I; // expected-warning {{declaration does not declare anything}} |
Chris Lattner | d4b19d5 | 2009-05-12 21:44:00 +0000 | [diff] [blame] | 22 | |
| 23 | |
| 24 | |
| 25 | // rdar://6880449 |
| 26 | register int test1; // expected-error {{illegal storage class on file-scoped variable}} |
| 27 | register int test2 __asm__("edi"); // expected-error {{global register variables are not supported}} |
| 28 | |