1a5728872c7702ddd09537c95bc3cbd20e1f2fb09Daniel Dunbar// RUN: %clang_cc1 %s -fsyntax-only -verify
2e80a59cc41d42a970466cb020b6f44c5b8831d70Chris Lattner
3a4ed0d8d75212dc01b4438829a4b0c846d99458dSebastian Redl// See Sema::ParsedFreeStandingDeclSpec about the double diagnostic
4c7f811638f8603fa373d2be724e8b1c8ba51ad75Richard Smithtypedef union <anonymous> __mbstate_t;  // expected-error {{declaration of anonymous union must be a definition}} expected-warning {{typedef requires a name}}
5fd89bc825026e44c68a68db72d4012fd6752e70fChris Lattner
6fd89bc825026e44c68a68db72d4012fd6752e70fChris Lattner
7fd89bc825026e44c68a68db72d4012fd6752e70fChris Lattner// PR2017
8fd89bc825026e44c68a68db72d4012fd6752e70fChris Lattnervoid x();
9fd89bc825026e44c68a68db72d4012fd6752e70fChris Lattnerint a() {
100947b4e6c778ca94bbd0a56548de0b6b5ff1dfc9Chris Lattner  int r[x()];  // expected-error {{size of array has non-integer type 'void'}}
115186872629d6c9a48433bafe62dc06975bbbf7afChris Lattner
125186872629d6c9a48433bafe62dc06975bbbf7afChris Lattner  static y ?; // expected-error{{unknown type name 'y'}} \
13d8ac05753dc4506224d445ff98399c01da3136e5John McCall                 expected-error{{expected identifier or '('}}
14fd89bc825026e44c68a68db72d4012fd6752e70fChris Lattner}
15fd89bc825026e44c68a68db72d4012fd6752e70fChris Lattner
16cb821d045f5e445384f34d05a526955036073c4aDouglas Gregorint; // expected-warning {{declaration does not declare anything}}
17c7f811638f8603fa373d2be724e8b1c8ba51ad75Richard Smithtypedef int; // expected-warning {{typedef requires a name}}
18cb821d045f5e445384f34d05a526955036073c4aDouglas Gregorconst int; // expected-warning {{declaration does not declare anything}}
19cb821d045f5e445384f34d05a526955036073c4aDouglas Gregorstruct; // expected-error {{declaration of anonymous struct must be a definition}} // expected-warning {{declaration does not declare anything}}
20a4ed0d8d75212dc01b4438829a4b0c846d99458dSebastian Redltypedef int I;
21cb821d045f5e445384f34d05a526955036073c4aDouglas GregorI; // expected-warning {{declaration does not declare anything}}
22d4b19d52416c3a04a1740ab5e766d9537c8ea00eChris Lattner
23d4b19d52416c3a04a1740ab5e766d9537c8ea00eChris Lattner
24d4b19d52416c3a04a1740ab5e766d9537c8ea00eChris Lattner
25d4b19d52416c3a04a1740ab5e766d9537c8ea00eChris Lattner// rdar://6880449
26d4b19d52416c3a04a1740ab5e766d9537c8ea00eChris Lattnerregister int test1;     // expected-error {{illegal storage class on file-scoped variable}}
27d4b19d52416c3a04a1740ab5e766d9537c8ea00eChris Lattner
28