blob: c7ec6dd725d62e8f1b547ebf06d413a7601fedde [file] [log] [blame]
Daniel Dunbar8fbe78f2009-12-15 20:14:24 +00001// RUN: %clang_cc1 %s -fsyntax-only -verify
Chris Lattner02c04392007-07-25 00:24:17 +00002
Sebastian Redla2b5e312008-12-28 15:28:59 +00003// See Sema::ParsedFreeStandingDeclSpec about the double diagnostic
Richard Smithb1402ae2013-03-18 22:52:47 +00004typedef union <anonymous> __mbstate_t; // expected-error {{declaration of anonymous union must be a definition}} expected-warning {{typedef requires a name}}
Chris Lattner81cb9e82008-04-02 01:05:10 +00005
6
7// PR2017
8void x();
9int a() {
Chris Lattner4fc69792008-11-24 01:28:17 +000010 int r[x()]; // expected-error {{size of array has non-integer type 'void'}}
Chris Lattner14bdb782009-04-12 20:51:10 +000011
12 static y ?; // expected-error{{unknown type name 'y'}} \
John McCalld5a36322009-11-03 19:26:08 +000013 expected-error{{expected identifier or '('}}
Chris Lattner81cb9e82008-04-02 01:05:10 +000014}
15
Douglas Gregorf19ac0e2010-04-08 21:33:23 +000016int; // expected-warning {{declaration does not declare anything}}
Richard Smithb1402ae2013-03-18 22:52:47 +000017typedef int; // expected-warning {{typedef requires a name}}
Douglas Gregorf19ac0e2010-04-08 21:33:23 +000018const int; // expected-warning {{declaration does not declare anything}}
19struct; // expected-error {{declaration of anonymous struct must be a definition}} // expected-warning {{declaration does not declare anything}}
Sebastian Redla2b5e312008-12-28 15:28:59 +000020typedef int I;
Douglas Gregorf19ac0e2010-04-08 21:33:23 +000021I; // expected-warning {{declaration does not declare anything}}
Chris Lattnerd98e7cf72009-05-12 21:44:00 +000022
23
24
25// rdar://6880449
26register int test1; // expected-error {{illegal storage class on file-scoped variable}}
Chris Lattnerd98e7cf72009-05-12 21:44:00 +000027