https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114630
--- Comment #8 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Nathaniel Shead <nsh...@gcc.gnu.org>: https://gcc.gnu.org/g:02917ac4528e32d1b2d0da5f45ef5937c56942cd commit r15-101-g02917ac4528e32d1b2d0da5f45ef5937c56942cd Author: Nathaniel Shead <nathanielosh...@gmail.com> Date: Thu Apr 11 19:15:35 2024 +1000 c++: Don't emit unused GMF partial specializations [PR114630] The change in r14-8408 to also emit partial specializations in the global module fragment caused the regression in the linked PR; this patch fixes this by restricting emitted GM partial specializations to those that are actually used. PR c++/114630 gcc/cp/ChangeLog: * module.cc (depset::hash::add_partial_entities): Mark GM specializations as unreached. (depset::hash::find_dependencies): Also reach entities in the DECL_TEMPLATE_SPECIALIZATIONS list. gcc/testsuite/ChangeLog: * g++.dg/modules/partial-3.C: New test. Signed-off-by: Nathaniel Shead <nathanielosh...@gmail.com>