view gcc/testsuite/g++.dg/cpp0x/implicit4.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
line wrap: on
line source

// Test that a base with only a move constructor causes the implicit copy
// constructor to be deleted.
// { dg-do compile { target c++11 } }

struct A			// { dg-message "declares a move" }
{
  A();
  A(A&&);
};

struct B: A			// { dg-error "use of deleted" }
{
};

int main()
{
  B b1;
  B b2(b1);		    // { dg-error "deleted function .B::B.const" }
  B b3(static_cast<B&&>(b1));
}