Steve Naroff | 7cbb146 | 2007-07-31 12:34:36 +0000 | [diff] [blame^] | 1 | // RUN: clang -parse-ast-check %s -pedantic |
| 2 | |
| 3 | typedef int TInt; |
| 4 | |
| 5 | static 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 | } |