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

--- Comment #13 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:5425159d176a7a92afc932cbb22d8822667099c4

commit r13-6422-g5425159d176a7a92afc932cbb22d8822667099c4
Author: Patrick Palka <ppa...@redhat.com>
Date:   Thu Mar 2 14:04:50 2023 -0500

    c++: more mce_false folding from cp_fully_fold_init [PR108243]

    We should also fold the overall initializer passed to cp_fully_fold_init
    with mce_false, which allows folding of the copy-initialization of
    'a1' in the below testcase (the initializer here is an AGGR_INIT_EXPR).

    Unfortunately this doesn't help with direct- or default-initialization
    because we don't call cp_fully_fold_init in that case, and even if we
    did the initializer in that case is expressed as a bare CALL_EXPR
    instead of an AGGR_INIT_EXPR, which cp_fully_fold_init can't really
    fold.

            PR c++/108243
            PR c++/97553

    gcc/cp/ChangeLog:

            * cp-gimplify.cc (cp_fully_fold): Add an internal overload that
            additionally takes and propagate an mce_value parameter, and
            define the existing public overload in terms of it.
            (cp_fully_fold_init): Pass mce_false to cp_fully_fold.

    gcc/testsuite/ChangeLog:

            * g++.dg/opt/is_constant_evaluated3.C: New test.

Reply via email to