2 // { dg-options "-fexceptions" }
3 // { dg-skip-if "requires hosted libstdc++ for stdexcept" { ! hostedlib } }
13 class B : public A { };
16 // These should all work.
17 const B& b2 = dynamic_cast<B&>(a);
18 const B& b3 = dynamic_cast<const B&>((const A&)a);
19 const B& b4 = dynamic_cast<const B&>(a);
26 } catch (std::exception& e) {
27 // If we get a bad_cast, it is wrong.