OSDN Git Service

new
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 15 May 2000 01:08:23 +0000 (01:08 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 15 May 2000 01:08:23 +0000 (01:08 +0000)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@33903 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/g++.old-deja/g++.eh/catch10.C [new file with mode: 0644]

diff --git a/gcc/testsuite/g++.old-deja/g++.eh/catch10.C b/gcc/testsuite/g++.old-deja/g++.eh/catch10.C
new file mode 100644 (file)
index 0000000..639f166
--- /dev/null
@@ -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
+}