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

--- Comment #1 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Marek Polacek <[email protected]>:

https://gcc.gnu.org/g:99e133ae0b93ca33cae497cf3aeeb19567dc910b

commit r17-6499-g99e133ae0b93ca33cae497cf3aeeb19567dc910b
Author: Marek Polacek <[email protected]>
Date:   Wed Nov 18 14:01:37 2026 -0500

    c++/reflection: fixes for eval_reflect_* [PR128855]

    Some of the eval_reflect_* functions return error_mark_node without setting
    *non_constant_p.  As a result, a variable's initializer ends up holding
    a value containing error_mark_node, and a later display_string_of on it
    crashes in dump_data_member_spec.

    I noticed that these errors can be emitted multiple times, so guard them
    with cxx_constexpr_quiet_p.  Also fix printing the wrong type in
    reflect_{object,function}.

            PR c++/128855

    gcc/cp/ChangeLog:

            * reflect.cc (eval_reflect_constant): Set *non_constant_p after
            giving an error.  Guard the error_at call with
            cxx_constexpr_quiet_p.
            (eval_reflect_object): Likewise.  Print type rather than
            TREE_TYPE (type) in the error.
            (eval_reflect_function): Likewise.

    gcc/testsuite/ChangeLog:

            * g++.dg/reflect/crash24.C: New test.

    Reviewed-by: Jason Merrill <[email protected]>

Reply via email to