2013-09-12 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / g++.dg / parse / array-size2.C
blob355ed6133b4586103456c94cc826ca4cb485b2fe
1 // PR c/25682
2 // { dg-do compile }
3 // Test whether we don't ICE on questionable constructs where offsetof
4 // should have been used instead.
6 struct S
8   char a[4];
9   int b;
12 extern void bar (char *, char *);
14 void
15 foo (void)
17   char g[(char *) &((struct S *) 0)->b - (char *) 0];
18   char h[(__SIZE_TYPE__) &((struct S *) 8)->b];
19   bar (g, h);