This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/23513] [4.0/4.1 Regression] overload resolution fails to select a more specialized template
- From: "nathan at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 16 Sep 2005 13:37:17 -0000
- Subject: [Bug c++/23513] [4.0/4.1 Regression] overload resolution fails to select a more specialized template
- References: <20050822093824.23513.maxim.yegorushkin@gmail.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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