summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/defaulted58.C
blob: 920a4ad0c6d282fd37c697ff6242217b580d159c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Core Issue #1331 (const mismatch with defaulted copy constructor)
// { dg-do compile { target c++11 } }

struct M
{
  M() = default;
  M& operator=(M&);
};

template<typename T> struct W
{
  W() = default;
  W& operator=(const W&) = default; // { dg-error "binding" }
  T t;
};

int
main ()
{
  W<M> w1, w2;
  w1 = w2; // { dg-error "use of deleted function" }
}