------- Comment #2 from rguenth at gcc dot gnu dot org 2008-11-06 12:08 ------- Even the following fails
extern "C" void abort (); struct B_ { }; struct D_ : public B_ { }; D_ d_; void f_ (B_ &) { } template < class T > void g_ () { return f_ (d_); } int main () { g_<int> (); return 0; } void f_ (D_ &) { abort (); } where f_ (D_ &) must not be even in the 2nd stage name-lookup overload set. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38030