summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/decl-invalid.c
blob: 78a9ee1d4bfb1e96d26b7f962dfadb8d7856735f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// RUN: clang %s -fsyntax-only -verify

// See Sema::ParsedFreeStandingDeclSpec about the double diagnostic
typedef union <anonymous> __mbstate_t;  // expected-error {{declaration of anonymous union must be a definition}} expected-error {{declaration does not declare anything}}


// PR2017
void x(); 
int a() {
  int r[x()];  // expected-error {{size of array has non-integer type 'void'}}
}

int; // expected-error {{declaration does not declare anything}}
typedef int; // expected-error {{declaration does not declare anything}}
const int; // expected-error {{declaration does not declare anything}}
struct; // expected-error {{declaration of anonymous struct must be a definition}} // expected-error {{declaration does not declare anything}}
typedef int I;
I; // expected-error {{declaration does not declare anything}}
OpenPOWER on IntegriCloud