gcc/testsuite/g++.dg/conversion/to-virtual-base-1.C
raw| 1 | // Copyright (C) 2002 Free Software Foundation |
| 2 | // Contributed by Gabriel Dos Reis <[email protected]> |
| 3 | |
| 4 | struct A { |
| 5 | virtual void f(const A* a) = 0; |
| 6 | }; |
| 7 | |
| 8 | struct B : virtual A { |
| 9 | virtual void f(const A* a); |
| 10 | }; |
| 11 | |
| 12 | void B::f(const A* a) |
| 13 | { |
| 14 | static_cast<const B&>(*a); // { dg-error "" } |
| 15 | } |