summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/constexpr-base4.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/cpp0x/constexpr-base4.C')
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-base4.C28
1 files changed, 28 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-base4.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-base4.C
new file mode 100644
index 000000000..ce23cb9dd
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-base4.C
@@ -0,0 +1,28 @@
+// PR c++/46626
+// { dg-do run }
+// { dg-options "-std=c++0x" }
+
+struct A
+{
+ virtual void f () = 0;
+ virtual ~A () { }
+};
+
+struct B : A
+{
+ virtual void f () { }
+};
+
+static void
+foo (A *a)
+{
+ a->f ();
+}
+
+int
+main ()
+{
+ B b;
+ foo (&b);
+ return 0;
+}