| 1 |
// PR c++/92145 |
| 2 |
// { dg-do compile { target c++11 } } |
| 3 |
// { dg-additional-options "-Wdeprecated-copy" } |
| 4 |
|
| 5 |
struct base |
| 6 |
{ |
| 7 |
base() { } |
| 8 |
base(const base&) { } |
| 9 |
base(base&&) { } |
| 10 |
base& operator=(const base&) { return *this; } |
| 11 |
base& operator=(base&&) { return *this; } |
| 12 |
}; |
| 13 |
|
| 14 |
struct foo : base |
| 15 |
{ |
| 16 |
//using base::base; |
| 17 |
using base::operator=; |
| 18 |
}; |
| 19 |
|
| 20 |
struct bar |
| 21 |
{ |
| 22 |
bar& operator=(foo v) |
| 23 |
{ |
| 24 |
value = v; |
| 25 |
return *this; |
| 26 |
} |
| 27 |
|
| 28 |
foo value; |
| 29 |
}; |
| 30 |
|
| 31 |
int main() |
| 32 |
{ |
| 33 |
foo a; |
| 34 |
foo{a}; |
| 35 |
} |