This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/33409] Overload Resolution Succeeds When Actually Ambiguous.
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Sep 2007 14:30:24 -0000
- Subject: [Bug c++/33409] Overload Resolution Succeeds When Actually Ambiguous.
- References: <bug-33409-15091@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from bangerth at dealii dot org 2007-09-24 14:30 -------
My reasoning would be that in the call d%g, the type of the two
expressions are 'double&' and 'A&'. So to call the user-defined
operator%, only the first argument has to be converted to 'A' for which
a conversion constructor is available. On the other hand, to use the
built-in operator%, the first argument has to undergo a floating-integral
conversion, and the second argument a conversion operator call to 'long'.
That's two vs one conversion operation.
That said, this is only my gut feeling, I won't have the time right now
to find out the exact paragraphs, and I don't know my way around in this part
of the standard very well anyway...
W.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33409