blob: 051f0f7ffbccfc13759a85583782b80b9940508e [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'}} \
13 expected-error{{expected identifier or '('}} \
14 expected-error{{expected ';' at end of declaration}}
Chris Lattnerfd89bc82008-04-02 01:05:10 +000015}
16
Sebastian Redla4ed0d82008-12-28 15:28:59 +000017int; // expected-error {{declaration does not declare anything}}
18typedef int; // expected-error {{declaration does not declare anything}}
19const int; // expected-error {{declaration does not declare anything}}
20struct; // expected-error {{declaration of anonymous struct must be a definition}} // expected-error {{declaration does not declare anything}}
21typedef int I;
22I; // expected-error {{declaration does not declare anything}}
Chris Lattnerd4b19d52009-05-12 21:44:00 +000023
24
25
26// rdar://6880449
27register int test1; // expected-error {{illegal storage class on file-scoped variable}}
28register int test2 __asm__("edi"); // expected-error {{global register variables are not supported}}
29