On Tue, Oct 26, 2021 at 05:07:43PM -0400, Patrick Palka wrote: > The performance impact of the other calls to cxx_eval_outermost_const_expr > from p_c_e_1 is probably already mostly mitigated by the constexpr call > cache and the fact that we try to evaluate all calls to constexpr > functions during cp_fold_function anyway (at least with -O). So trial
constexpr function bodies don't go through cp_fold_function (intentionally, so that we don't optimize away UB), the bodies are copied before the trees of the normal copy are folded. Jakub