http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47294
Summary: definition of function template can be explicitly-qualified with a namespace it isn't a member of Product: gcc Version: 4.6.0 Status: UNCONFIRMED Keywords: accepts-invalid Severity: normal Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: r...@gcc.gnu.org namespace N { void f(); } template<typename T> void N::f(T) // ERROR does not match any declaration in N { } int main() { ::f(0); } This is forbidden by [namespace.memdef]p2 but g++ accepts it without error. EDG, Clang and Sun reject it. If there isn't an (incompatible) overload of N::f then g++ rejects it.