------- Comment #1 from pinskia at gcc dot gnu dot org 2008-05-06 15:44 ------- This is correct behavior.
template<class T> void bar( T& v ) { v.foo(); } template<class T> void bar( B<T>& x ) { bar( *x ); } template<class T> void bar( A<T>& x ) { bar( *x ); } Since A<T> is not in the namespace N, the second bar only sees itself and the first bar (in its overloaded set). If you want working code use the following: namespace N { template<class T> void bar( T& v ); template<class T> void bar( B<T>& x ); template<class T> void bar( A<T>& x ); template<class T> void bar( T& v ) { v.foo(); } template<class T> void bar( B<T>& x ) { bar( *x ); } template<class T> void bar( A<T>& x ) { bar( *x ); } } -- pinskia at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |INVALID http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36151