Skip analyzer strndup test on hppa*-*-hpux*
[official-gcc.git] / gcc / testsuite / gcc.dg / c23-typeof-2.c
blob0c42a07f709ba4dc4af20c2d53a0f9d12b3e730e
1 /* Test C23 typeof and typeof_unqual. Invalid code. */
2 /* { dg-do compile } */
3 /* { dg-options "-std=c23 -pedantic-errors" } */
5 struct s { int i : 2; } x;
6 union u { unsigned int j : 1; } y;
8 typeof (x.i) j; /* { dg-error "applied to a bit-field" } */
9 typeof_unqual (x.i) j2; /* { dg-error "applied to a bit-field" } */
10 typeof (y.j) j3; /* { dg-error "applied to a bit-field" } */
11 typeof_unqual (y.j) j4; /* { dg-error "applied to a bit-field" } */
13 static int ok (void);
14 static int also_ok (void);
15 static int not_defined (void); /* { dg-error "used but never defined" } */
16 static int also_not_defined (void); /* { dg-error "used but never defined" } */
18 void
19 f (void)
21 typeof (ok ()) x = 2;
22 typeof_unqual (also_ok ()) y = 2;
23 int a[2];
24 int (*p)[x] = &a;
25 typeof (p + not_defined ()) q;
26 typeof_unqual (p + also_not_defined ()) q2;