xref: /minix3/external/bsd/llvm/dist/clang/test/Sema/decl-invalid.c (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 %s -fsyntax-only -verify
2*f4a2713aSLionel Sambuc 
3*f4a2713aSLionel Sambuc // See Sema::ParsedFreeStandingDeclSpec about the double diagnostic
4*f4a2713aSLionel Sambuc typedef union <anonymous> __mbstate_t;  // expected-error {{declaration of anonymous union must be a definition}} expected-warning {{typedef requires a name}}
5*f4a2713aSLionel Sambuc 
6*f4a2713aSLionel Sambuc 
7*f4a2713aSLionel Sambuc // PR2017
8*f4a2713aSLionel Sambuc void x();
9*f4a2713aSLionel Sambuc int a() {
10*f4a2713aSLionel Sambuc   int r[x()];  // expected-error {{size of array has non-integer type 'void'}}
11*f4a2713aSLionel Sambuc 
12*f4a2713aSLionel Sambuc   static y ?; // expected-error{{unknown type name 'y'}} \
13*f4a2713aSLionel Sambuc                  expected-error{{expected identifier or '('}}
14*f4a2713aSLionel Sambuc }
15*f4a2713aSLionel Sambuc 
16*f4a2713aSLionel Sambuc int; // expected-warning {{declaration does not declare anything}}
17*f4a2713aSLionel Sambuc typedef int; // expected-warning {{typedef requires a name}}
18*f4a2713aSLionel Sambuc const int; // expected-warning {{declaration does not declare anything}}
19*f4a2713aSLionel Sambuc struct; // expected-error {{declaration of anonymous struct must be a definition}} // expected-warning {{declaration does not declare anything}}
20*f4a2713aSLionel Sambuc typedef int I;
21*f4a2713aSLionel Sambuc I; // expected-warning {{declaration does not declare anything}}
22*f4a2713aSLionel Sambuc 
23*f4a2713aSLionel Sambuc 
24*f4a2713aSLionel Sambuc 
25*f4a2713aSLionel Sambuc // rdar://6880449
26*f4a2713aSLionel Sambuc register int test1;     // expected-error {{illegal storage class on file-scoped variable}}
27*f4a2713aSLionel Sambuc 
28