xref: /llvm-project/clang/test/Parser/typeof.c (revision 0f1c1be1968076d6f96f8a7bcc4a15cf195ecd97)
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 
3 typedef int TInt;
4 
test(void)5 static void test(void) {
6   int *pi;
7 
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}}
10   int int ttt; // expected-error{{cannot combine with previous 'int' declaration specifier}}
11   typeof(TInt) anInt;
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}}
14   typeof(void ary[7]) anIntError; // expected-error{{expected ')'}} expected-note {{to match this '('}}  expected-error {{variable has incomplete type 'typeof(void)' (aka 'void')}}
15   typeof(const int) aci;
16   const typeof (*pi) aConstInt;
17   int xx;
18   int *i;
19 }
20 
test2(void)21 void test2(void) {
22     int a;
23     short b;
24     __typeof__(a) (*f)(__typeof__(b));
25 }
26