* g++.old-deja/g++.other/dcast2.C: cannot dynamic downcast &x
authorAlexandre Oliva <oliva@dcc.unicamp.br>
Thu, 29 Oct 1998 13:58:38 +0000 (13:58 +0000)
committerAlexandre Oliva <oliva@gcc.gnu.org>
Thu, 29 Oct 1998 13:58:38 +0000 (13:58 +0000)
From-SVN: r23429

gcc/testsuite/ChangeLog
gcc/testsuite/g++.old-deja/g++.other/dcast2.C [new file with mode: 0644]

index d0e2a39ab9e29adc0ce52f0480c29b6feac76c60..2b0bf97e69ddf593c99d8573fbdc6094200148ad 100644 (file)
@@ -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 (file)
index 0000000..e1bd1c1
--- /dev/null
@@ -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);
+}