From-SVN: r33903
This commit is contained in:
Jason Merrill 2000-05-14 21:08:23 -04:00
parent 40c954b902
commit c2b2bca636

View File

@ -0,0 +1,21 @@
// Test that we notice unfortunate handler ordering.
struct A { };
struct B: public A { };
struct C: private A { };
void f();
void g()
{
try { f(); }
catch (...) { } // ERROR - ... followed by others
catch (A*) { }
try { f(); }
catch (A*) { } // WARNING - A* before B*
catch (B*) { } // WARNING - A* before B*
try { f(); }
catch (A*) { }
catch (C*) { } // no warning; A is private base
}