re PR c++/58923 (g++ does not use provided conversion function for implicit conversio...
authorPaolo Carlini <paolo.carlini@oracle.com>
Tue, 24 Mar 2015 17:22:27 +0000 (17:22 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Tue, 24 Mar 2015 17:22:27 +0000 (17:22 +0000)
2015-03-24  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/58923
* g++.dg/other/virtual3.C: New.

From-SVN: r221640

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/other/virtual3.C [new file with mode: 0644]

index dadd843921daac700475ce15e02e30edf62312e8..4ec4386a80800e706753896baf5e5c3faee5cf30 100644 (file)
@@ -1,3 +1,8 @@
+2015-03-24  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/58923
+       * g++.dg/other/virtual3.C: New.
+
 2015-03-24  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/60130
diff --git a/gcc/testsuite/g++.dg/other/virtual3.C b/gcc/testsuite/g++.dg/other/virtual3.C
new file mode 100644 (file)
index 0000000..55c8185
--- /dev/null
@@ -0,0 +1,25 @@
+// PR c++/58923
+
+struct A
+{
+  virtual void do_it() const = 0;
+};
+
+struct B :  A
+{
+  virtual void do_it() const {}
+};
+
+struct C
+{
+  operator B() const { return B(); }
+};
+
+void do_it(const A& a) { a.do_it(); }
+
+int main()
+{
+  C c;
+  do_it(c);
+  return 0;
+}