| 1 |
// { dg-do run } |
| 2 |
|
| 3 |
int c; |
| 4 |
|
| 5 |
struct Base { |
| 6 |
Base() {} |
| 7 |
Base(const Base &) { ++c; } |
| 8 |
Base & operator = (const Base &); |
| 9 |
}; |
| 10 |
|
| 11 |
struct Derived : public Base {}; |
| 12 |
|
| 13 |
const Base &b = Derived(); |
| 14 |
|
| 15 |
int main() |
| 16 |
{ |
| 17 |
return c; // No copies should be required. |
| 18 |
} |