undetected overloading ambiguity ?

Martin v. Loewis martin@loewis.home.cs.tu-berlin.de
Thu Feb 24 14:11:00 GMT 2000


> The following example illustrate what seems to be a (small) 
> bug in gcc, basicaly, an overloaded function (let's call 
> them f1 and f1) is called with two argument, gcc rightly 
> select f1 for the first argument and f2 for the second. Yet, 
> it fails to detect ambiguity when both arguments are 
> provided.

Thanks for your bug report. This appears to be the result of an
extension; with -pedantic, gcc says

a.cc: In function `int main()':
a.cc:24: call of overloaded `f (A *, int)' is ambiguous
a.cc:8: candidates are: void f(const A *, int)
a.cc:9:                 void f(A *, B *)

Regards,
Martin



More information about the Gcc-bugs mailing list