https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94078
Martin Sebor <msebor at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution|--- |FIXED --- Comment #3 from Martin Sebor <msebor at gcc dot gnu.org> --- Fixed in r10-7424. GCC's poutput is now as expected: $ gcc -O2 -S -Wall -Wmismatched-tags -Wredundant-tags pr94078.C pr94078.C:2:8: warning: redundant class-key ‘class’ in reference to ‘struct S<int>’ [-Wredundant-tags] 2 | extern class S<int> si; // missing -Wmismatched-tags | ^~~~~ | ----- pr94078.C:3:8: warning: redundant class-key ‘struct’ in reference to ‘class S<int>’ [-Wredundant-tags] 3 | extern struct S<int> si; // bogus -Wmismatched-tags | ^~~~~~ | ------ pr94078.C:2:14: warning: ‘S<int>’ declared with a mismatched class-key ‘class’ [-Wmismatched-tags] 2 | extern class S<int> si; // missing -Wmismatched-tags | ^~~~~~ pr94078.C:2:14: note: replace the class-key with ‘struct’ pr94078.C:1:25: note: ‘S<int>’ first declared as ‘struct’ here 1 | template <class> struct S; | ^