[Bug c++/61987] Name Resolution within a Template

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Aug 1 10:28:00 GMT 2014


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61987

--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
G++ and clang++ call f(double) four times, because that is the only function
visible in the template definition. foo(int) is only visible at the point of
instantiation, so could only be found by ADL, but int has no associated
namespaces.

EDG does call foo(int) twice, and fails to compile because the call with
unsigned long argument could call foo(double) or foo(int) and so is ambiguous.

So either the code never calls foo(int) or the code doesn't compile!



More information about the Gcc-bugs mailing list