blob: 823551f02e6fe22aede70c3be8f7c89657a2b3c9 [file] [log] [blame]
Daniel Dunbard7d5f022009-03-24 02:24:46 +00001// RUN: clang-cc %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 Lattner51868722009-04-12 20:51:10 +000011
12 static y ?; // expected-error{{unknown type name 'y'}} \
John McCalld8ac0572009-11-03 19:26:08 +000013 expected-error{{expected identifier or '('}}
Chris Lattnerfd89bc82008-04-02 01:05:10 +000014}
15
Sebastian Redla4ed0d82008-12-28 15:28:59 +000016int; // expected-error {{declaration does not declare anything}}
17typedef int; // expected-error {{declaration does not declare anything}}
18const int; // expected-error {{declaration does not declare anything}}
19struct; // expected-error {{declaration of anonymous struct must be a definition}} // expected-error {{declaration does not declare anything}}
20typedef int I;
21I; // expected-error {{declaration does not declare anything}}
Chris Lattnerd4b19d52009-05-12 21:44:00 +000022
23
24
25// rdar://6880449
26register int test1; // expected-error {{illegal storage class on file-scoped variable}}
27register int test2 __asm__("edi"); // expected-error {{global register variables are not supported}}
28