https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120040
--- 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:48a9567e4100fd6a734089087c139d51b63b7531 commit r16-1737-g48a9567e4100fd6a734089087c139d51b63b7531 Author: Nathaniel Shead <nathanielosh...@gmail.com> Date: Tue May 20 23:09:07 2025 +1000 c++/modules: Support streaming new size cookie for constexpr [PR120040] This type currently has a DECL_NAME of an IDENTIFIER_DECL. Although the documentation indicates this is legal, this confuses modules streaming which expects all RECORD_TYPEs to have a TYPE_DECL, which is used to determine the context and merge key, etc. PR c++/120040 gcc/cp/ChangeLog: * constexpr.cc (cxx_eval_constant_expression): Handle TYPE_NAME now being a TYPE_DECL rather than just an IDENTIFIER_NODE. * init.cc (build_new_constexpr_heap_type): Build a TYPE_DECL for the returned type; mark the type as artificial. * module.cc (trees_out::type_node): Add some assertions. gcc/testsuite/ChangeLog: * g++.dg/modules/pr120040_a.C: New test. * g++.dg/modules/pr120040_b.C: New test. Signed-off-by: Nathaniel Shead <nathanielosh...@gmail.com> Reviewed-by: Jason Merrill <ja...@redhat.com>