https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111608
mauro russo <ing.russomauro at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ing.russomauro at gmail dot com --- Comment #5 from mauro russo <ing.russomauro at gmail dot com> --- If I may contribute, I am completely in line with the explanation by Jonathan Wakely, and I believe gcc is correct, but I guess the standard text might be more clear about it. In particular, let me contribute referring the final part of the clause §13.7.5-1 in n4849 draft for C++20 (part of [temp.class.spec]), as it reads "A partial specialization shall be declared before the first use of a class template specialization that would make use of the partial specialization as the result of an implicit or explicit instantiation in every translation unit in which such a use occurs; no diagnostic is required.", supporting the answer by Jonathan Wakely. About the implicit instantiation, there is §13.9.3-16 of n4849 (part of [temp.expl.spec])... I don't really like it is so late within §13.9.3, as it is really important, together the aforementioned §13.7.5-1, as well as §13.9.3-7 that similarly forbids to introduce the explicit specialization after the points where it would have been used. However, when you refine a member of the implicit instantiation, you cannot freely re-define the class members, but they have to 'correspond' to the member declaration of the specialization selected for the implicit instantiation, and in this case you satisfy this rule as you have 'f' function with no parameters and void return type. What I dislike is that I did not find in the standard explicit rules for such correspondence, expect the implicit examples in §13.9.3-6, but practical tests on gcc seems to indicate that common sense applies, as functions must remain functions, with the same involved types, classes must remain classes (struct/class ?), member templates must remain as such, and so on.