Debian Codegraph @

gcc/testsuite/g++.dg/parse/offsetof6.C

raw
1 /* { dg-do compile } */
2
3 // From PR28573
4
5 struct A
6 {
7 char d[44];
8 char &operator [] ( int indx ) { return d[indx]; }
9 };
10
11 struct B
12 {
13 A a;
14 };
15
16 int main()
17 {
18 return __builtin_offsetof(B, a[0]); /* { dg-error "cannot apply.*offsetof" } */
19 }