This code isn't rejected, though it should be: ---------------------------- namespace NS { template <typename> void f(); } template <typename> void NS::f (int); --------------------------- It _is_ rejected if NS::f is not a template. FWIW, icc says this to the snippet: tmp/y> icc -Xc -ansi -c x.cc x.cc(6): error: function template "NS::f" may not be redeclared in the current scope template <typename> void NS::f (int); ^ W.
-- Summary: Declaration in wrong namespace not rejected Product: gcc Version: 3.4.3 Status: UNCONFIRMED Keywords: accepts-invalid Severity: normal Priority: P2 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: bangerth at dealii dot org CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21534