Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/g++.dg/abi/no_unique_address1.C @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | |
children |
line wrap: on
line source
// { dg-do run { target c++2a } } struct B { }; struct A { [[no_unique_address]] B b; int i; }; struct C { B b; int i; }; struct D: B { }; struct E { B b [[no_unique_address]]; D d [[no_unique_address]]; }; constexpr bool same (void *x, void *y) { return x == y; } int main() { A a; if (!same(&a.b, &a.i)) __builtin_abort(); C c; if (same(&c.b, &c.i)) __builtin_abort(); E e; if (same (&e.b, &e.d)) __builtin_abort(); }