blob: 211c5127026c63e42c53995c3527201de92e5df9 [file] [log] [blame]
// PR c++/68711 - [5 regression] SEGV on an invalid offsetof of a member
// of a virtual base
// { dg-do compile }
struct A { int i; };
struct B: virtual A { };
int a[] = {
!&((B*)0)->i, // { dg-error "invalid access to non-static data member" }
__builtin_offsetof (B, i) // { dg-error "invalid access to non-static" }
}; // { dg-message "offsetof within non-standard-layout type" "" { target *-*-* } .-1 }