blob: e14bc9891a455840ed83e0e5ebaf59bc81a6a18a [file] [log] [blame]
Daniel Dunbarffd408a2009-03-24 02:24:46 +00001// RUN: clang-cc %s -fsyntax-only -verify
Chris Lattner4b009652007-07-25 00:24:17 +00002
Sebastian Redlb7605e82008-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 Lattner67d3c8d2008-04-02 01:05:10 +00005
6
7// PR2017
8void x();
9int a() {
Chris Lattnercc884cc2008-11-24 01:28:17 +000010 int r[x()]; // expected-error {{size of array has non-integer type 'void'}}
Chris Lattner6de1e002009-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 Lattner67d3c8d2008-04-02 01:05:10 +000015}
16
Sebastian Redlb7605e82008-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}}