From: Paolo Carlini Date: Tue, 24 Mar 2015 17:22:27 +0000 (+0000) Subject: re PR c++/58923 (g++ does not use provided conversion function for implicit conversio... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e5bca5f62ed46cc290a5ed458ca808dafa8f9640;p=gcc.git 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 --- 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; +}