From e5bca5f62ed46cc290a5ed458ca808dafa8f9640 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Tue, 24 Mar 2015 17:22:27 +0000 Subject: [PATCH] re PR c++/58923 (g++ does not use provided conversion function for implicit conversion to another type) 2015-03-24 Paolo Carlini PR c++/58923 * g++.dg/other/virtual3.C: New. From-SVN: r221640 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/other/virtual3.C | 25 +++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 gcc/testsuite/g++.dg/other/virtual3.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index dadd843921d..4ec4386a808 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-03-24 Paolo Carlini + + PR c++/58923 + * g++.dg/other/virtual3.C: New. + 2015-03-24 Paolo Carlini 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 index 00000000000..55c81855714 --- /dev/null +++ b/gcc/testsuite/g++.dg/other/virtual3.C @@ -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; +} -- 2.30.2