Steve Naroff | 11b649c | 2007-08-01 17:20:42 +0000 | [diff] [blame^] | 1 | // RUN: clang -parse-ast-check %s |
Steve Naroff | 7cbb146 | 2007-07-31 12:34:36 +0000 | [diff] [blame] | 2 | |
| 3 | typedef int TInt; |
| 4 | |
| 5 | static void test() { |
| 6 | int *pi; |
| 7 | |
Steve Naroff | 11b649c | 2007-08-01 17:20:42 +0000 | [diff] [blame^] | 8 | 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 Naroff | 4c255ab | 2007-07-31 23:56:32 +0000 | [diff] [blame] | 10 | int int ttt; // expected-error{{cannot combine with previous 'int' declaration specifier}} |
Steve Naroff | 11b649c | 2007-08-01 17:20:42 +0000 | [diff] [blame^] | 11 | typeof(TInt) anInt; |
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}} |
Steve Naroff | 11b649c | 2007-08-01 17:20:42 +0000 | [diff] [blame^] | 14 | typeof(void ary[7]) anIntError; // expected-error{{expected ')'}} expected-error{{to match this '('}} |
| 15 | typeof(const int) aci; |
| 16 | const typeof (*pi) aConstInt; |
Steve Naroff | 7cbb146 | 2007-07-31 12:34:36 +0000 | [diff] [blame] | 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 *'}} |
Steve Naroff | 11b649c | 2007-08-01 17:20:42 +0000 | [diff] [blame^] | 21 | i = aConstInt; // expected-warning{{incompatible types assigning 'typeof(*pi) const' to 'int *'}} |
Steve Naroff | 7cbb146 | 2007-07-31 12:34:36 +0000 | [diff] [blame] | 22 | i = xx; // expected-warning{{incompatible types assigning 'int' to 'int *'}} |
| 23 | } |