aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/eh/template2.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg/eh/template2.C')
-rw-r--r--gcc-4.9/gcc/testsuite/g++.dg/eh/template2.C19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/eh/template2.C b/gcc-4.9/gcc/testsuite/g++.dg/eh/template2.C
new file mode 100644
index 000000000..ed3893286
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.dg/eh/template2.C
@@ -0,0 +1,19 @@
+// { dg-do compile }
+// { dg-options -O2 }
+
+template<class T> struct O {
+ O(T *p) : q(p) { }
+ T *q;
+};
+struct W {
+ virtual ~W();
+};
+struct S : public W {
+ S (int *);
+};
+W *bar(int);
+S::S (int *x)
+{
+ for (int *p = x; *p; p++)
+ O<W> i (bar (*p));
+}