J
Juha Nieminen
Consider the following program:
//-----------------------------------------------------------------------
template<typename T>
void foo(T v) { bar(v); }
void bar(int) {}
int main() { foo(5); }
//-----------------------------------------------------------------------
gcc compiles this just fine, but clang gives an error:
error: call to function 'bar' that is neither visible in the
template definition nor found by argument-dependent lookup
Which one is right?
//-----------------------------------------------------------------------
template<typename T>
void foo(T v) { bar(v); }
void bar(int) {}
int main() { foo(5); }
//-----------------------------------------------------------------------
gcc compiles this just fine, but clang gives an error:
error: call to function 'bar' that is neither visible in the
template definition nor found by argument-dependent lookup
Which one is right?