https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118582
--- Comment #3 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:21cccfa91e6ed172062e0c62682422269c914937 commit r15-7146-g21cccfa91e6ed172062e0c62682422269c914937 Author: Nathaniel Shead <nathanielosh...@gmail.com> Date: Wed Jan 22 21:24:03 2025 +1100 c++/modules: Fix exporting temploid friends in header units [PR118582] When we started streaming the bit to handle merging of imported temploid friends in r15-2807, I unthinkingly only streamed it in the '!state->is_header ()' case. This patch reworks the streaming logic to ensure that this data is always streamed, including for unique entities (in case that ever comes up somehow). This does make the streaming slightly less efficient, as functions and types will need an extra byte, but this doesn't appear to make a huge difference to the size of the resulting module; the 'std' module on my machine grows by 0.2% from 30671136 to 30730144 bytes. PR c++/118582 gcc/cp/ChangeLog: * module.cc (trees_out::decl_value): Always stream imported_temploid_friends information. (trees_in::decl_value): Likewise. gcc/testsuite/ChangeLog: * g++.dg/modules/pr118582_a.H: New test. * g++.dg/modules/pr118582_b.H: New test. * g++.dg/modules/pr118582_c.H: New test. Signed-off-by: Nathaniel Shead <nathanielosh...@gmail.com>