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

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

https://gcc.gnu.org/g:c0e310500b4298596f140a0884915090f11aa60e

commit r17-6734-gc0e310500b4298596f140a0884915090f11aa60e
Author: Ivan Lazaric <[email protected]>
Date:   Thu Nov 26 09:55:42 2026 -0500

    c++/reflection: Purge consteval-only variables earlier [PR128386]

    Removal of consteval-only variables needs to be performed before
    sanitizer related code, because it tries to genericize them.
    Otherwise the consteval-only variables would be considered used
    by the function, which would erroneously cause a constexpr function
    to escalate to consteval, and a regular function to not compile.

            PR c++/128386

    gcc/cp/ChangeLog:

            * cp-gimplify.cc (cp_genericize_r) <case BIND_EXPR>:
            Remove consteval-only variables before sanitizer checks.

    gcc/testsuite/ChangeLog:

            * g++.dg/reflect/pr128386-1.C: New test.
            * g++.dg/reflect/pr128386-2.C: New test.

    Signed-off-by: Ivan Lazaric <[email protected]>
    Reviewed-by: Jason Merrill <[email protected]>

Reply via email to