Daniel Dunbar | ffd408a | 2009-03-24 02:24:46 +0000 | [diff] [blame] | 1 | // RUN: clang-cc %s -fsyntax-only -verify |
Chris Lattner | 4b00965 | 2007-07-25 00:24:17 +0000 | [diff] [blame] | 2 | |
Sebastian Redl | b7605e8 | 2008-12-28 15:28:59 +0000 | [diff] [blame] | 3 | // See Sema::ParsedFreeStandingDeclSpec about the double diagnostic |
| 4 | typedef union <anonymous> __mbstate_t; // expected-error {{declaration of anonymous union must be a definition}} expected-error {{declaration does not declare anything}} |
Chris Lattner | 67d3c8d | 2008-04-02 01:05:10 +0000 | [diff] [blame] | 5 | |
| 6 | |
| 7 | // PR2017 |
| 8 | void x(); |
| 9 | int a() { |
Chris Lattner | cc884cc | 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 | 6de1e00 | 2009-04-12 20:51:10 +0000 | [diff] [blame] | 11 | |
| 12 | static y ?; // expected-error{{unknown type name 'y'}} \ |
| 13 | expected-error{{expected identifier or '('}} \ |
| 14 | expected-error{{expected ';' at end of declaration}} |
Chris Lattner | 67d3c8d | 2008-04-02 01:05:10 +0000 | [diff] [blame] | 15 | } |
| 16 | |
Sebastian Redl | b7605e8 | 2008-12-28 15:28:59 +0000 | [diff] [blame] | 17 | int; // expected-error {{declaration does not declare anything}} |
| 18 | typedef int; // expected-error {{declaration does not declare anything}} |
| 19 | const int; // expected-error {{declaration does not declare anything}} |
| 20 | struct; // expected-error {{declaration of anonymous struct must be a definition}} // expected-error {{declaration does not declare anything}} |
| 21 | typedef int I; |
| 22 | I; // expected-error {{declaration does not declare anything}} |