re PR c++/67184 (Missed optimization with C++11 final specifier)
[official-gcc.git] / gcc / testsuite / g++.dg / other / offsetof8.C
blobdaca70a6fe4c24ee3e075c90cf1fbde69669c605
1 // PR c++/68711 - [5 regression] SEGV on an invalid offsetof of a member
2 //                of a virtual base
3 // { dg-do compile }
5 struct A { int i; };
7 struct B: virtual A { };
9 int a[]  = {
10   !&((B*)0)->i,    // { dg-error "invalid access to non-static data member" }
11   __builtin_offsetof (B, i)   // { dg-error "invalid access to non-static" }