2 // { dg-options "-fexceptions" }
12 class B : public A { };
15 // These should all work.
16 const B& b2 = dynamic_cast<B&>(a);
17 const B& b3 = dynamic_cast<const B&>((const A&)a);
18 const B& b4 = dynamic_cast<const B&>(a);
25 } catch (std::exception& e) {
26 // If we get a bad_cast, it is wrong.