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 | |
Steve Naroff | 4c255ab | 2007-07-31 23:56:32 +0000 | [diff] [blame^] | 8 | int typeof (int) aIntInt; // expected-error{{cannot combine with previous 'int' declaration specifier}} expected-warning{{extension used}} |
| 9 | short typeof (int) aShortInt; // expected-error{{'short typeof' is invalid}} expected-warning{{extension used}} |
| 10 | int int ttt; // expected-error{{cannot combine with previous 'int' declaration specifier}} |
Steve Naroff | 7cbb146 | 2007-07-31 12:34:36 +0000 | [diff] [blame] | 11 | typeof(TInt) anInt; // expected-warning{{extension used}} |
Steve Naroff | 4c255ab | 2007-07-31 23:56:32 +0000 | [diff] [blame^] | 12 | short TInt eee; // expected-error{{parse error}} |
| 13 | void ary[7] fff; // expected-error{{array has incomplete element type 'void'}} expected-error{{parse error}} |
| 14 | typeof(void ary[7]) anIntError; // expected-warning{{extension used}} expected-error{{expected ')'}} expected-error{{to match this '('}} |
Steve Naroff | 7cbb146 | 2007-07-31 12:34:36 +0000 | [diff] [blame] | 15 | typeof(const int) aci; // expected-warning{{extension used}} |
| 16 | const typeof (*pi) aConstInt; // expected-warning{{extension used}} |
| 17 | int xx; |
Steve Naroff | 7cbb146 | 2007-07-31 12:34:36 +0000 | [diff] [blame] | 18 | 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 *'}} |
| 21 | i = aConstInt; // expected-warning{{incompatible types assigning 'typeof(<expr>) const' to 'int *'}} |
| 22 | i = xx; // expected-warning{{incompatible types assigning 'int' to 'int *'}} |
| 23 | } |