blob: 4829713b272fb92d234dd1bc6648d379c86946db [file] [log] [blame]
Steve Naroff7cbb1462007-07-31 12:34:36 +00001// RUN: clang -parse-ast-check %s -pedantic
2
3typedef int TInt;
4
5static void test() {
6 int *pi;
7
8 typeof(TInt) anInt; // expected-warning{{extension used}}
9 typeof(const int) aci; // expected-warning{{extension used}}
10 const typeof (*pi) aConstInt; // expected-warning{{extension used}}
11 int xx;
12 short typeof (*pi) aShortInt; // expected-error{{'short typeof' is invalid}}
13 int *i;
14 i = aci; // expected-warning{{incompatible types assigning 'typeof(int const)' to 'int *'}}
15 i = anInt; // expected-warning{{incompatible types assigning 'typeof(TInt)' to 'int *'}}
16 i = aConstInt; // expected-warning{{incompatible types assigning 'typeof(<expr>) const' to 'int *'}}
17 i = xx; // expected-warning{{incompatible types assigning 'int' to 'int *'}}
18}