------- Comment #5 from bangerth at dealii dot org 2007-05-09 16:34 ------- The code originally given is indeed ambiguous. It boils down to this: ------------------- namespace boo { template <typename T> void work(T n); template <typename T> struct R { };
template <typename T> void rfunc(const R<T>& a) { using boo::work; work(a); } } namespace hpc { template <typename T> void work(T n); struct B { }; boo::R<B> n; void bfunc(void) { rfunc(n); } } ----------------- In boo:rfunc, we call work(a). Because 'a' is template dependent, we search the current as well as all namespaces associated with the template arguments. This includes namespace hpc. As for the question why the qualified version "work<R<T> >(a)" works fine -- this is subject of one of the Defect Reports dealing with the question whether argument dependent lookup also applies to functions with specified template parameter lists. W. -- bangerth at dealii dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bangerth at dealii dot org Status|UNCONFIRMED |RESOLVED Resolution| |INVALID http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31855