| 1 |
// PR c++/31449 |
| 2 |
|
| 3 |
class Foo {}; |
| 4 |
class Bar : public Foo {}; |
| 5 |
static const Foo *foo = 0; |
| 6 |
|
| 7 |
static Bar *bar = static_cast<const Bar*>(foo); // { dg-error "conversion" } |
| 8 |
|
| 9 |
void func(const Foo *foo) { |
| 10 |
Bar *bar = static_cast<const Bar*>(foo); // { dg-error "conversion" } |
| 11 |
} |