https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47342
Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed|2017-09-26 00:00:00 |2021-5-12 Severity|enhancement |normal --- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> --- I was about to report a new bug, but I think it's another case of this one: template<typename T> struct S { }; template<typename T> struct X { }; template<typename T> struct S<X<T>>; // line 5 void f(S<X<int>>* s) { s->x; } This prints: loc.C: In function 'void f(S<X<int> >*)': loc.C:9:4: error: invalid use of incomplete type 'struct S<X<int> >' 9 | s->x; | ^~ loc.C:1:29: note: declaration of 'struct S<X<int> >' 1 | template<typename T> struct S { }; | ^ The note shows the declaration of the primary template, which is not incomplete. The relevant declaration is the one on line 5.