This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/10380: warning about "choosing ... over ..." when there is no choice
- From: nathan at gcc dot gnu dot org
- To: gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, lehn at mathematik dot uni-ulm dot de, nobody at gcc dot gnu dot org, stip at mathematik dot uni-ulm dot de
- Date: 20 Apr 2003 13:39:39 -0000
- Subject: Re: c++/10380: warning about "choosing ... over ..." when there is no choice
- Reply-to: nathan at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, lehn at mathematik dot uni-ulm dot de, nobody at gcc dot gnu dot org, stip at mathematik dot uni-ulm dot de, gcc-gnats at gcc dot gnu dot org
Synopsis: warning about "choosing ... over ..." when there is no choice
State-Changed-From-To: analyzed->closed
State-Changed-By: nathan
State-Changed-When: Sun Apr 20 13:39:39 2003
State-Changed-Why:
not a bug. a = c, is equivalent to a.operator= (c)
The candidate function is A::operator=(A const &)
There are two user-defined conversion sequences to convert
'c' to 'A const &', these are
1) const qualify C, apply C::operator A () const
2) apply C::operator B (), convert to A const &
these are indistinguishable conversion sequences, and
therefore the call is ill-formed. G++ is not so picky about
things, and finds a conversion that works, but might not be the one you expected.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10380