[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / Sema / decl-invalid.c
blobfca708c9bbe8a119ab422243bfcaf3671d7b831e
1 // RUN: %clang_cc1 %s -fsyntax-only -verify
3 // See Sema::ParsedFreeStandingDeclSpec about the double diagnostic
4 typedef union <anonymous> __mbstate_t; // expected-error {{declaration of anonymous union must be a definition}} expected-warning {{typedef requires a name}}
7 // PR2017
8 void x(void);
9 int a(void) {
10 int r[x()]; // expected-error {{size of array has non-integer type 'void'}}
12 static y ?; // expected-error{{unknown type name 'y'}} \
13 expected-error{{expected identifier or '('}}
16 int; // expected-warning {{declaration does not declare anything}}
17 typedef int; // expected-warning {{typedef requires a name}}
18 const int; // expected-warning {{declaration does not declare anything}}
19 struct; // expected-error {{declaration of anonymous struct must be a definition}} // expected-warning {{declaration does not declare anything}}
20 typedef int I;
21 I; // expected-warning {{declaration does not declare anything}}
25 // rdar://6880449
26 register int test1; // expected-error {{illegal storage class on file-scoped variable}}