aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Oliva <oliva@dcc.unicamp.br>1998-10-29 13:58:38 +0000
committerAlexandre Oliva <oliva@gcc.gnu.org>1998-10-29 13:58:38 +0000
commit60049c8def3e6e834f5cfaf9c0ff6de2e6e083b8 (patch)
treed0250d322cb7592e204ff0d89ba02084dc5d6429
parent124e57323716bfe1d0cb69a1516c158f72c777ed (diff)
downloadgcc-60049c8def3e6e834f5cfaf9c0ff6de2e6e083b8.zip
gcc-60049c8def3e6e834f5cfaf9c0ff6de2e6e083b8.tar.gz
gcc-60049c8def3e6e834f5cfaf9c0ff6de2e6e083b8.tar.bz2
* g++.old-deja/g++.other/dcast2.C: cannot dynamic downcast &x
From-SVN: r23429
-rw-r--r--gcc/testsuite/ChangeLog2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/dcast2.C17
2 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index d0e2a39..2b0bf97 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,7 @@
1998-10-29 Alexandre Oliva <oliva@dcc.unicamp.br>
+ * g++.old-deja/g++.other/dcast2.C: cannot dynamic downcast &x
+
* g++.old-deja/g++.other/init9.C: test cross initialization of
non-POD types
diff --git a/gcc/testsuite/g++.old-deja/g++.other/dcast2.C b/gcc/testsuite/g++.old-deja/g++.other/dcast2.C
new file mode 100644
index 0000000..e1bd1c1
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/dcast2.C
@@ -0,0 +1,17 @@
+// Build don't link:
+
+// Based on a testcase by Ruslan Shevchenko <Ruslan@Shevchenko.Kiev.UA>
+
+struct B {
+ virtual ~B();
+};
+
+struct D : public B {
+};
+
+void foo() {
+ B x;
+ dynamic_cast<D*>(&x); // gets bogus error - XFAIL *-*-*
+ B* p = &x;
+ dynamic_cast<D*>(p);
+}