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 <nathanieloshead@gmail.com>