On Mon, Sep 18, 2023 at 09:36:31PM -0400, Jason Merrill wrote: > On 9/18/23 17:42, Marek Polacek wrote: > > + /* The purpose of this is not to emit errors for mce_unknown. */ > > + const tsubst_flags_t complain = (data->flags == ff_fold_immediate > > + ? tf_none : tf_error); > > Maybe check flags & ff_mce_false, instead? OK with that change.
Thanks! And what do you think about: --- a/gcc/cp/cp-gimplify.cc +++ b/gcc/cp/cp-gimplify.cc @@ -1162,7 +1162,8 @@ cp_fold_r (tree *stmt_p, int *walk_subtrees, void *data_) tree stmt = *stmt_p; enum tree_code code = TREE_CODE (stmt); - cp_fold_immediate_r (stmt_p, walk_subtrees, data); + if (cxx_dialect > cxx17) + cp_fold_immediate_r (stmt_p, walk_subtrees, data); *stmt_p = stmt = cp_fold (*stmt_p, data->flags); since we can recurse on ?:, this could save some time. It's sad that it checks cxx_dialect in every invocation of cp_fold_r but still, it should help. Thanks again for the reviews, Marek