1 // PR c++/35321 2 3 struct A 4 { 5 A operator[] (int); 6 }; 7 8 struct B 9 { 10 A a; 11 }; 12 foo()13 void foo() 14 { 15 __builtin_offsetof(B, a[0]); /* { dg-error "cannot apply 'offsetof' when 'operator\\\[\\\]' is overloaded" } */ 16 } 17