https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101338
Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Target|x86-64 | Build|Homebrew GCC 11.1.0_1 | Status|UNCONFIRMED |NEW Last reconfirmed| |2021-07-12 Host|macOS 11.4 | Ever confirmed|0 |1 --- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> --- All your examples are missing a semi-colon after the struct definition. The corrected last example is: struct A { template <int, int> struct Inner; template <int i> struct Inner<0, i> {}; }; struct B: A { template <int, int> struct Inner; // OK, shadows declaration in A template <int i> struct Inner<0, i> {}; template <int, int> struct Inner; // Fail, redeclaration. };