blob: 78a9ee1d4bfb1e96d26b7f962dfadb8d7856735f [file] [log] [blame]
Chris Lattner3b427b32007-10-11 00:18:28 +00001// RUN: clang %s -fsyntax-only -verify
Chris Lattnere80a59c2007-07-25 00:24:17 +00002
Sebastian Redla4ed0d82008-12-28 15:28:59 +00003// See Sema::ParsedFreeStandingDeclSpec about the double diagnostic
4typedef union <anonymous> __mbstate_t; // expected-error {{declaration of anonymous union must be a definition}} expected-error {{declaration does not declare anything}}
Chris Lattnerfd89bc82008-04-02 01:05:10 +00005
6
7// PR2017
8void x();
9int a() {
Chris Lattner0947b4e2008-11-24 01:28:17 +000010 int r[x()]; // expected-error {{size of array has non-integer type 'void'}}
Chris Lattnerfd89bc82008-04-02 01:05:10 +000011}
12
Sebastian Redla4ed0d82008-12-28 15:28:59 +000013int; // expected-error {{declaration does not declare anything}}
14typedef int; // expected-error {{declaration does not declare anything}}
15const int; // expected-error {{declaration does not declare anything}}
16struct; // expected-error {{declaration of anonymous struct must be a definition}} // expected-error {{declaration does not declare anything}}
17typedef int I;
18I; // expected-error {{declaration does not declare anything}}