[Bug c++/105931] [12/13 regression] ICE in cxx_eval_constant_expression

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Jun 23 20:38:18 GMT 2022


--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Patrick Palka <ppalka@gcc.gnu.org>:


commit r13-1225-gb00b95198e6720eb23a2618870d67800f6180fdd
Author: Patrick Palka <ppalka@redhat.com>
Date:   Thu Jun 23 16:36:43 2022 -0400

    c++: constexpr folding in unevaluated context [PR105931]

    Changing the type of N from int to unsigned in decltype82.C (from
    r13-986-g0ecb6b906f215e) reveals another spot where we perform constexpr
    evaluation in an unevaluated context for sake of warnings, this time
    from the call to shorten_compare in cp_build_binary_op, which calls

    We could (and probably should) suppress the shorten_compare warnings
    when in an unevaluated context, but there's probably other callers of
    fold_for_warn that are similarly affected.  So this patch takes the
    approach of directly suppressing fold_for_warn when in an unevaluated

            PR c++/105931


            * expr.cc (fold_for_warn): Don't fold when in an unevaluated


            * g++.dg/cpp0x/decltype82a.C: New test.

More information about the Gcc-bugs mailing list