PR c++/85277 - ICE with invalid offsetof.
[official-gcc.git] / gcc / testsuite / g++.dg / ext / builtin-offsetof1.C
blobcbc2daafbdd8bfc5b187ba7296ce763d8c8da596
1 // PR c++/51413
2 // PR c++/85277
3 // { dg-options "-Wno-pointer-arith" }
5 struct A
7   static void foo();
8 };
10 int i = __builtin_offsetof(A, foo[1]);  // { dg-error "offsetof" }
11 int j = __builtin_offsetof(volatile A, foo[0]);  // { dg-error "offsetof" }