------- Comment #3 from bangerth at dealii dot org 2007-09-23 18:23 ------- This actually turns out to be a serious bug in several different ways.
Here's self-contained code: ------------------- namespace X { template<typename T> struct H { typedef typename T::type type; }; template<typename T> typename H<T>::type foo(T); } namespace M { struct A {}; using X::foo; } namespace N { template <class> struct S {}; class Q : S<M::A> {}; int foo(Q); } int i = foo (N::Q()); --------------------- We get this: g/x> c++ -c y.ii y.ii: In instantiation of 'X::H<N::Q>': y.ii:18: instantiated from here y.ii:2: error: no type named 'type' in 'class N::Q' Note that in the call to foo, all arguments have associated namespace N, so X::foo shouldn't be considered. The fact that we do is bug 1. Bug 2 is that even if we consider X::foo, we should realize that the return type of X::foo can't be instantiated for this template argument, since X::H<T>::type doesn't exist. That we don't silently give up means that we aren't doing SFINAE right. I'll try to come up with a wrong-code version of this in a minute. W. -- bangerth at dealii dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |rejects-valid Summary|unused code changes the |invalid Koenig lookup |result of name lookup | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33518