https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96219
Bug ID: 96219 Summary: New Feature (c++ core 727): explicit specialization in class definition should be allowed Product: gcc Version: 11.0 Status: UNCONFIRMED Keywords: rejects-valid Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: haoxintu at gmail dot com Target Milestone: --- Hi,all. http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#727 According to above link, explicit specialization in class definition should be allowed. For example, $cat test.cc class A { template <class> void F(){}; template <> void F<int>(); }; $g++ -std=c++17 test.cc test.cc:3:15: error: explicit specialization in non-namespace scope 'class A' 3 | template <> void F<int>(); | ^ test.cc:3:22: error: template-id 'F<int>' in declaration of primary template 3 | template <> void F<int>(); | ^~~~~~ I report this because of the related discussion in llvm: https://bugs.llvm.org/show_bug.cgi?id=46728 Thanks, Haoxin