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

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

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

commit r12-1792-gc06493dc30afbf65b14d783c7cd53f20877ef577
Author: Patrick Palka <ppa...@redhat.com>
Date:   Thu Jun 24 11:29:02 2021 -0400

    c++: requires-expression folding [PR101182]

    Here we're crashing because cp_fold_function walks into the (templated)
    requirements of a requires-expression outside a template, but the
    folding routines aren't prepared to handle templated trees.  This patch
    fixes this by making cp_fold use evaluate_requires_expr to fold a
    requires-expression as a whole, which also means we no longer need to
    explicitly do so during gimplification.  (Note that we delay folding
    of such requires-expressions for sake of better diagnostics when one is
    used as the condition of a failed static_assert.)

            PR c++/101182

    gcc/cp/ChangeLog:

            * constraint.cc (evaluate_requires_expr): Adjust function comment.
            * cp-gimplify.c (cp_genericize_r) <case REQUIRES_EXPR>: Move to ...
            (cp_fold) <case REQUIRES_EXPR>: ... here.

    gcc/testsuite/ChangeLog:

            * g++.dg/cpp2a/concepts-requires25.C: New test.

Reply via email to