blob: 14025e58095f505287ad259c2c63ea26eaab9deb [file] [log] [blame]
Steve Naroff11b649c2007-08-01 17:20:42 +00001// RUN: clang -parse-ast-check %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;
Steve Naroff4c255ab2007-07-31 23:56:32 +000012 short TInt eee; // expected-error{{parse error}}
13 void ary[7] fff; // expected-error{{array has incomplete element type 'void'}} expected-error{{parse error}}
Steve Naroff11b649c2007-08-01 17:20:42 +000014 typeof(void ary[7]) anIntError; // expected-error{{expected ')'}} expected-error{{to match this '('}}
15 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;
19 i = aci; // expected-warning{{incompatible types assigning 'typeof(int const)' to 'int *'}}
20 i = anInt; // expected-warning{{incompatible types assigning 'typeof(TInt)' to 'int *'}}
Steve Naroff11b649c2007-08-01 17:20:42 +000021 i = aConstInt; // expected-warning{{incompatible types assigning 'typeof(*pi) const' to 'int *'}}
Steve Naroff7cbb1462007-07-31 12:34:36 +000022 i = xx; // expected-warning{{incompatible types assigning 'int' to 'int *'}}
23}