aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.jason/dcast1.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.jason/dcast1.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.jason/dcast1.C20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/dcast1.C b/gcc/testsuite/g++.old-deja/g++.jason/dcast1.C
new file mode 100644
index 00000000000..f4d93c3c068
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.jason/dcast1.C
@@ -0,0 +1,20 @@
+// PRMS Id: 7162
+// Build don't link:
+
+struct B {
+ int i;
+ B() : i(1) {}
+};
+
+struct D : B {
+ int i;
+ D() : i(2) {}
+};
+
+void ch()
+{
+ D od2;
+ D &rd2 = od2;
+
+ B &rd1 = dynamic_cast<B&>(rd2);
+}