Merge from mainline (165734:167278).
[official-gcc/graphite-test-results.git] / gcc / testsuite / g++.dg / abi / empty6.C
blob1b14a6d03bec1fc2a9d2beffc3a9783e9e81ba12
1 // { dg-options "-Wabi -fabi-version=1" }
3 struct A {};
5 struct B {
6   A a; // { dg-warning "empty" "" { xfail mmix-*-* } }
7   virtual void f () {}
8 } __attribute__((aligned(2 * sizeof (void *))));
9 /* The preceding attribute is necessary on targets with
10    BIGGEST_ALIGNMENT <= POINTER_SIZE to trigger the warning, as
11    otherwise the offset of 'a' (i.e. POINTER_SIZE) is split into a
12    non-zero DECL_FIELD_OFFSET and a zero DECL_FIELD_BIT_OFFSET,
13    and then there is no discrepancy between DECL_FIELD_OFFSET and
14    byte_position to warn about.  */