Daniel Dunbar | 3573b2c | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %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; |
Chris Lattner | 2c41d48 | 2009-03-29 17:18:04 +0000 | [diff] [blame] | 12 | short TInt eee; // expected-error{{expected ';' at end of declaration}} |
| 13 | void ary[7] fff; // expected-error{{array has incomplete element type 'void'}} expected-error{{expected ';' at end of declaration}} |
Argiris Kirtzidis | 53f0548 | 2009-05-22 10:22:18 +0000 | [diff] [blame] | 14 | typeof(void ary[7]) anIntError; // expected-error{{expected ')'}} expected-note {{to match this '('}} expected-error {{variable has incomplete type 'typeof(void)' (aka 'void')}} |
Steve Naroff | 11b649c | 2007-08-01 17:20:42 +0000 | [diff] [blame] | 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; |
Steve Naroff | 7cbb146 | 2007-07-31 12:34:36 +0000 | [diff] [blame] | 19 | } |
Douglas Gregor | 73aa14d | 2010-07-28 18:22:12 +0000 | [diff] [blame] | 20 | |
| 21 | // <rdar://problem/8237491> |
| 22 | void test2() { |
| 23 | int a; |
| 24 | short b; |
| 25 | __typeof__(a) (*f)(__typeof__(b)); |
| 26 | } |