https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78274
Bug ID: 78274 Summary: Rejected specialization in different namespace Product: gcc Version: 6.1.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: jakub at gcc dot gnu.org Target Milestone: --- I've noticed that clang++ accepts, but g++ rejects: namespace std { template<typename T> struct tuple_size; } struct A { int x, y, z; }; template<> struct std::tuple_size<A> { static const int value = 3; }; constexpr int a = std::tuple_size<A>::value; test.C:3:24: error: specialization of ‘template<class T> struct std::tuple_size’ in different namespace [-fpermissive] template<> struct std::tuple_size<A> { static const int value = 3; }; ^~~~~~~~~~~~~ test.C:1:45: error: from definition of ‘template<class T> struct std::tuple_size’ [-fpermissive] namespace std { template<typename T> struct tuple_size; } ^~~~~~~~~~ Is that a g++ or clang++ bug?