http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56760
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |INVALID --- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> 2013-03-28 07:14:14 UTC --- Note I think this undefined code at compile time due to specializations happen after their use though the reason why it fails are a different reason. This is expected behavior for the following reason: In the second case, we have an argument dependent lookup that happens in the global namespace so the overloaded set includes all of them at instantiation time too. So it picks the one which is specialized for seco::holder<T>. But in the first case the overload set only includes the first two and does not know about one for seco::holder<T> and never looks for it as argument depend lookup only happens in seco and nam as the two argument types are located in those namespaces.