https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101287
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> --- The actual code is required though, as https://gcc.gnu.org/bugs says: template<class T> struct C { void f() { T x; } void g() = delete; }; C<void> c; // OK, definition of C<void>::f is not instantiated at this point template<> void C<int>::g() { } // error: redefinition of C<int>::g int main(){}