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

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

https://gcc.gnu.org/g:0943fcaca7dd3415546f68397c24e38afaffaf3d

commit r16-8680-g0943fcaca7dd3415546f68397c24e38afaffaf3d
Author: Patrick Palka <[email protected]>
Date:   Tue Apr 14 15:36:54 2026 -0400

    c++: reference to static local meta::info as targ [PR124824]

    Here we're crashing in discriminator_for_local_entity during mangling
    of f<&M>() because determine_local_discriminator is never called for
    the static local meta::info M.  The relevant code path in cp_finish_decl
    was disabled for consteval-only types in the main Reflection commit
    r16-6808 to avoid creating a varpool_node for such types.

    This patch naively fixes this by moving the consteval_only_p check so
    that we still call determine_local_discriminator for such types.

            PR c++/124824

    gcc/cp/ChangeLog:

            * decl.cc (cp_finish_decl): Sink !consteval_only_p check to
            only guard the varpool_node::get_create call.

    gcc/testsuite/ChangeLog:

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

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

Reply via email to