https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97460
--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Nathan Sidwell <nat...@gcc.gnu.org>: https://gcc.gnu.org/g:ccb4f20cbee1756c464033bbdda2f27b6aa2a63f commit r11-4015-gccb4f20cbee1756c464033bbdda2f27b6aa2a63f Author: Nathan Sidwell <nat...@acm.org> Date: Fri Oct 16 10:22:16 2020 -0700 c++: Fix nullptr deref [pr97460[ My changes to friend handling meant that there are now cases where a friend doesn't get a lang-specific object. So we need to check there is one before looking inside it. PR c++/97460 gcc/cp/ * pt.c (push_template_decl): Check DECL_LANG_SPECIFIC in friend case. gcc/testsuite/ * g++.dg/template/pr97460.C: New.