https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119938

--- Comment #1 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:d613678c94f06809656e56b37f314501b37a5ddd

commit r16-318-gd613678c94f06809656e56b37f314501b37a5ddd
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>

Reply via email to