view gcc/testsuite/g++.dg/cpp0x/inh-ctor21.C @ 152:2b5abeee2509

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents 04ced10e8804
children
line wrap: on
line source

// PR c++/70972
// { dg-do run { target c++11 } }

struct abort_on_copy{
    abort_on_copy(abort_on_copy&&) = default;
    abort_on_copy(const abort_on_copy&) { __builtin_abort(); }
    abort_on_copy() = default;
};

struct A {
    A(abort_on_copy) {}
};
struct B : A {
    using A::A;
};

int main() {
    B b(abort_on_copy{});
}