Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/g++.dg/cpp0x/dc6.C @ 152:2b5abeee2509
update gcc11
author | anatofuz |
---|---|
date | Mon, 25 May 2020 07:50:57 +0900 |
parents | 04ced10e8804 |
children |
line wrap: on
line source
// { dg-do run { target c++11 } } int a_ct; struct A { A(int i): i(i) { ++a_ct; } A(const A& a): i(a.i) { ++a_ct; } ~A() { --a_ct; } int i; }; struct V { V() { } }; struct B: virtual V { A a; B(A a): a(a) { } B(int i): B(A(i)) { } }; struct C: B { C(int i): B(i) { } }; int main() { { B b(42); C c(24); if (b.a.i != 42 ||c.a.i != 24) __builtin_abort (); } return a_ct; }