aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-base4.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-base4.C')
-rw-r--r--gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-base4.C27
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-base4.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-base4.C
new file mode 100644
index 0000000..ab66439
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-base4.C
@@ -0,0 +1,27 @@
+// PR c++/46626
+// { dg-do run { target c++11 } }
+
+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;
+}