OSDN Git Service

PR c++/28606
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / parse / array-size2.C
1 // PR c/25682
2 // { dg-do compile }
3 // Test whether we don't ICE on invalid array sizes.
4
5 struct S
6 {
7   char a[4];
8   int b;
9 };
10
11 extern void bar (char *, char *);
12
13 void
14 foo (void)
15 {
16   char g[(char *) &((struct S *) 0)->b - (char *) 0];   // { dg-error "not an integral constant-expression" }
17   char h[(__SIZE_TYPE__) &((struct S *) 8)->b];         // { dg-error "not an integral constant-expression" }
18   bar (g, h);
19 }