blob: a7c488023ae2e718f1e5f6dc481e0659cdfd15a9 [file] [log] [blame]
Daniel Dunbarffd408a2009-03-24 02:24:46 +00001// RUN: clang-cc -fsyntax-only -verify %s
Steve Naroff7cbb1462007-07-31 12:34:36 +00002
3typedef int TInt;
4
5static void test() {
6 int *pi;
7
Steve Naroff11b649c2007-08-01 17:20:42 +00008 int typeof (int) aIntInt; // expected-error{{cannot combine with previous 'int' declaration specifier}}
9 short typeof (int) aShortInt; // expected-error{{'short typeof' is invalid}}
Steve Naroff4c255ab2007-07-31 23:56:32 +000010 int int ttt; // expected-error{{cannot combine with previous 'int' declaration specifier}}
Steve Naroff11b649c2007-08-01 17:20:42 +000011 typeof(TInt) anInt;
Chris Lattner2c41d482009-03-29 17:18:04 +000012 short TInt eee; // expected-error{{expected ';' at end of declaration}}
13 void ary[7] fff; // expected-error{{array has incomplete element type 'void'}} expected-error{{expected ';' at end of declaration}}
Argiris Kirtzidis53f05482009-05-22 10:22:18 +000014 typeof(void ary[7]) anIntError; // expected-error{{expected ')'}} expected-note {{to match this '('}} expected-error {{variable has incomplete type 'typeof(void)' (aka 'void')}}
Steve Naroff11b649c2007-08-01 17:20:42 +000015 typeof(const int) aci;
16 const typeof (*pi) aConstInt;
Steve Naroff7cbb1462007-07-31 12:34:36 +000017 int xx;
Steve Naroff7cbb1462007-07-31 12:34:36 +000018 int *i;
Steve Naroff7cbb1462007-07-31 12:34:36 +000019}