https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119938
--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-15 branch has been updated by Nathaniel Shead <nsh...@gcc.gnu.org>: https://gcc.gnu.org/g:aa49bb9deb7e040679f184009f38c5027f1a8dc4 commit r15-9611-gaa49bb9deb7e040679f184009f38c5027f1a8dc4 Author: Nathaniel Shead <nathanielosh...@gmail.com> Date: Fri Apr 25 22:45:41 2025 +1000 c++/modules: Fix imported CNTTPs being considered non-constant [PR119938] When importing a CNTTP object, since r15-3031-g0b7904e274fbd6 we shortcut the processing of the generated NTTP so that we don't attempt to recursively load pendings. However, due to an oversight we do not properly set TREE_CONSTANT or DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P on the decl, which confuses later processing. This patch ensures that this happens correctly. PR c++/119938 gcc/cp/ChangeLog: * pt.cc (get_template_parm_object): When !check_init, add assert that expr really is constant and mark decl as such. gcc/testsuite/ChangeLog: * g++.dg/modules/tpl-nttp-2_a.H: New test. * g++.dg/modules/tpl-nttp-2_b.C: New test. Signed-off-by: Nathaniel Shead <nathanielosh...@gmail.com> Reviewed-by: Jason Merrill <ja...@redhat.com> (cherry picked from commit d613678c94f06809656e56b37f314501b37a5ddd)