[Bug c++/23513] [4.0/4.1 Regression] overload resolution fails to select a more specialized template
nathan at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Fri Sep 16 13:37:00 GMT 2005
------- Additional Comments From nathan at gcc dot gnu dot org 2005-09-16 13:37 -------
This is a piece of underspecification in the resolution of DR 214
(http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#214). That
basically tells one to compare pairs of arguments. But in this case we have a
member function and a non-member function -- how should we treat the this
pointer of the member function and the first arg of the non-member function?
As the algorithm did not give any indication as to how to order these, I made
them unordered.
Experimentation using the edg 3.6 frontend I find it to skip the first argument
of both functions (either an explicit arg or implicit this pointer) if either
function is a member function. The alternative, of comparing the this pointer
arg with the explicit arg of the other function requires treating the this
pointer argument as-if it were a reference to the object (otherwise it'll never
deduce in either direction as the explicit argument must be a by-value or
by-reference object). Experimentation shows the EDG front end does not take
that approach.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23513
More information about the Gcc-bugs
mailing list