http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480
Bug #: 56480 Summary: Explicit specialization in a namespace enclosing the specialized template Classification: Unclassified Product: gcc Version: 4.8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: zeratul...@hotmail.com The following code: namespace Foo { template <typename T> struct Meow { }; } template <> struct Foo::Meow<int> { }; fails to compile with gcc 4.8 (tested with 20130224 snapshot). I believe this code should be accepted in C++11 mode as per [temp.expl.spec] p2: "An explicit specialization shall be declared in a namespace enclosing the specialized template." This is a relaxation of the C++03 wording: "An explicit specialization shall be declared in the namespace of which the template is a member". Recent versions of clang and MSVC compile the above code in C++11 mode.