Re: Argument Dependent Lookup inside a template class
<fabio.tesser@gmail.com>Hello all,
int main(int argc, char *argv[]) {
simple_template<int> a;
a.ftest3(0);
}
gcc 4.3.2:
test_template_friend_function.cpp:12: error: no matching function for
call to ?ftest2(test)?
I know that there is the Argument Dependent Lookup, so the ftest2
should be recognised using the namespace of the types of the function
arguments.
ADL has nothing to do here, as T is int, and int has no namespaces
associated with it to search... Neither do you have namespaces...
But your code is okay as is, ftest2 must be visible at template definition,
and bound, then called. The code compiles with Cameau.
Do you think this is a bug of gcc 4.3.2?
Must be, though another post suggest it compiles.
The error msg is even more interesting, if the the name ftest2 was not
correctly produced, the error should be reported right at the template
definition, well before an instantiation attempt.
And if it got to the instantiation, the already bound function is bound, and
could be called.
Are you sure you compiled this very code?