diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/eh/template2.C')
-rw-r--r-- | gcc/testsuite/g++.dg/eh/template2.C | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/eh/template2.C b/gcc/testsuite/g++.dg/eh/template2.C new file mode 100644 index 000000000..ed3893286 --- /dev/null +++ b/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)); +} |