------- Comment #10 from pinskia at gcc dot gnu dot org 2005-12-25 02:14 ------- > We're still speaking about > > namespace X { > struct A {}; > struct B {}; > } > > void foo(X::A&); > > template <class T> > void g(T& t) > { > foo(t); > } > > void foo(X::B&); > > void bar(X::B& b) > { > g(b); > }
This is invalid as Koenig look cannot and will not find the second foo as it is not in the namespace X. The overloaded set for foo in g only contains the first foo and then when instantiating it, it reruns the Koenig rules and that says it can only find foo in the namespace X so the code is rejected. So this is a dup of bug 2922 after all. *** This bug has been marked as a duplicate of 2922 *** -- pinskia at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |DUPLICATE http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24795