blob: 7cc609645a23099d73219b0bf403cd41b89c9526 [file] [log] [blame]
// { dg-do assemble }
// Test that we notice unfortunate handler ordering.
struct A { };
struct B: public A { };
struct C: private A { };
void f();
void g()
{
try { f(); }
catch (...) { } // { dg-error "" } ... followed by others
catch (A*) { }
try { f(); }
catch (A*) { } // { dg-message "for type" } A* before B*
catch (B*) { } // { dg-warning "will be caught" } A* before B*
try { f(); }
catch (A*) { }
catch (C*) { } // no warning; A is private base
}