Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
Steve Naroff | d1861fd | 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 | 8d1a3b8 | 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 | 2cb64ec | 2007-07-31 23:56:32 +0000 | [diff] [blame] | 10 | int int ttt; // expected-error{{cannot combine with previous 'int' declaration specifier}} |
Steve Naroff | 8d1a3b8 | 2007-08-01 17:20:42 +0000 | [diff] [blame] | 11 | typeof(TInt) anInt; |
Chris Lattner | 23c4b18 | 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}} |
Argyrios Kyrtzidis | 6409625 | 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 | 8d1a3b8 | 2007-08-01 17:20:42 +0000 | [diff] [blame] | 15 | typeof(const int) aci; |
| 16 | const typeof (*pi) aConstInt; |
Steve Naroff | d1861fd | 2007-07-31 12:34:36 +0000 | [diff] [blame] | 17 | int xx; |
Steve Naroff | d1861fd | 2007-07-31 12:34:36 +0000 | [diff] [blame] | 18 | int *i; |
Steve Naroff | d1861fd | 2007-07-31 12:34:36 +0000 | [diff] [blame] | 19 | } |
Douglas Gregor | 2a3a1bd | 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 | } |