Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/g++.dg/abi/no_unique_address1.C @ 158:494b0b89df80 default tip
...
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 25 May 2020 18:13:55 +0900 |
parents | 84e7813d76e9 |
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(); }