The following code should fail to compile due to ambiguity (the non-template case properly fails):
template<typename> void foo(void); template<> void foo<int>(void); namespace { template<> void foo<int>(void) { return; } } int main(int, char **) { foo<int>(); } -- Summary: Accepts definition for non-anonymous specialized template method within anonymous namespace Product: gcc Version: 4.3.4 Status: UNCONFIRMED Severity: minor Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: Simon dot Richter at hogyros dot de GCC build triplet: x86_64-unknown-linux-gnu GCC host triplet: x86_64-unknown-linux-gnu GCC target triplet: x86_64-unknown-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42018