aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.jason/dtor4.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.jason/dtor4.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.jason/dtor4.C23
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/dtor4.C b/gcc/testsuite/g++.old-deja/g++.jason/dtor4.C
new file mode 100644
index 00000000000..dfdc3aafd6c
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.jason/dtor4.C
@@ -0,0 +1,23 @@
+// PRMS Id: 5420
+// Bug: g++ gets mixed up calling destructors for references.
+// Build don't link:
+
+template<class X>
+class Z {
+public:
+ char space[100];
+ void kill()
+ { X& x = (X&) space[0];
+ x.~X(); }
+};
+
+class C { int i; };
+
+void
+f()
+{
+ Z<int> r;
+ r.kill();
+ Z<C> s;
+ s.kill();
+}