On 10/21/19 2:49 PM, Jakub Jelinek wrote:
On Mon, Oct 21, 2019 at 01:59:38PM -0400, Jason Merrill wrote:
I agree that cp_fold isn't the right place, since it does lowering for GCC
internals, and consteval expansion is part of the language semantics.  So it
should happen before constexpr body saving, as in your patch.

It seems like we want a finish_full_expression, and do consteval folding
there (and not from finish_function).

The finish_function was just an attempt to limit the number of places where
we need to call it to a minimum.

Fair enough.  Maybe just a finish_unevaluated_operand then.

+  if (init && TREE_STATIC (decl))
+    init = cxx_eval_consteval (init);

Do we need this in addition to the cxx_constant_init in store_init_value?

Jason

Reply via email to