https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87862
Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |INVALID --- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> --- This looks like undefined behaviour. You have a template specialization in s.cpp but none of the other files can see that specialization exists, and so they implicitly instantiate t<z::e>::get_b based on the primary template, which returns a null pointer, which you dereference.