aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.eh/tmpl2.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.eh/tmpl2.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.eh/tmpl2.C33
1 files changed, 33 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.eh/tmpl2.C b/gcc/testsuite/g++.old-deja/g++.eh/tmpl2.C
new file mode 100644
index 00000000000..af3dc7bc12a
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.eh/tmpl2.C
@@ -0,0 +1,33 @@
+// Build don't link:
+// Special g++ flags: -O
+// crash test - XFAIL i*86-*-linux*
+
+// Posted by H. J. Lu <hjl@lucon.org>
+
+template<class T>
+class FixSeq
+{
+public:
+ void append(const T&);
+};
+class foo
+{
+public:
+ void setupIR();
+};
+typedef FixSeq<foo *> bar;
+extern void dummy (foo *);
+void *
+foobar (bar &x, foo *p)
+{
+ try
+ {
+ p -> setupIR();
+ }
+ catch(...)
+ {
+ dummy (p);
+ }
+ x.append(p);
+ return p;
+}