https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72763
Jason Merrill <jason at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |RESOLVED Resolution|--- |INVALID --- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> --- This looks well-formed to me; we don't substitute into C<T> until we need D to be complete, which we don't when we're just using A<int>. If you change the declaration of a to A<int>::D a; then you get the error you're expecting.