This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Call is not rejected as ambiguos


> 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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]