G++ accepts this invalid code: template <class T> struct base { void f(void*); }; template <class T> struct derived : base<T> { derived() { f(this); } /* note: f(0) breaks g++, too */ }; struct instanced : derived<unsigned> { instanced() {} }; See a recent discussion on news:comp.lang.c++.moderated about this: <http://groups.google.com/group/comp.lang.c++.moderated/browse_thread/thread/ba5a7a368233a022>
dup of PR 24163 ?
yes, I'm sure this is the same, as in the bug I reported, base<T>::f is only found if the expression is dependent (so lookup is delayed to instantiation time) but that shouldn't affect it. 14.6.2/3 is clear that dependent bases are not examined for unqualified name lookup at definition or instantiation *** This bug has been marked as a duplicate of bug 24163 ***