This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Call is not rejected as ambiguos
- To: ask at ispras dot ru
- Subject: Re: Call is not rejected as ambiguos
- From: "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>
- Date: Tue, 18 Jan 2000 01:55:56 +0100
- CC: gcc-bugs at gcc dot gnu dot org
- References: <Pine.GSO.4.21.0001172112180.10261-100000@zeus.ispras.ru>
> If two matches are found at the highest level where a match is found,
> tha call is rejected as ambiguous.
Thanks for your bug report. This is not a bug. Please have a look at
13.3.3.2/4 of the C++ standard, which says
# Two conversion sequences with the same rank are indistinguishable
# unless one of the following rules applies:
# - ...
# - If class B is derived directly or indirectly from class A,
# conversion of B* to A* is better than conversion of B* to void*, and
# conversion of A* to void* is better than conversion of B* to void*.
# - ...
There is a number of other conditions that allow to select a better
candidate; please refer to the International Standard for details. It
seems that Stroustrup has simplified his explanation a bit, probably
for methodical purposes.
Hope this helps,
Martin
P.S. If you are not satisfied with this response, please ask in
comp.std.c++ first, before discussing this further.