On 12/21/18 3:51 AM, Jakub Jelinek wrote:
On Thu, Dec 20, 2018 at 09:49:39PM -0500, Jason Merrill wrote:
But if we need cp_fully_fold, doesn't that mean that the earlier
cxx_eval_constant_expression failed and thus the argument is not a constant
expression? Should __builtin_is_constant_evaluated () evaluate to true
even if the argument is not a constant expression?
Ah, no, good point.
Is there a reason to call that maybe_constant_value at all when we've called
cxx_eval_constant_expression first? Wouldn't cp_fold_rvalue (or
c_fully_fold with false as last argument) be sufficient there?
I think that would be better, yes.
As cp_fold_rvalue* is static in cp-gimplify.c, I've used c_fully_fold
(or do you want to export cp_fold_rvalue*?).
Let's export it. OK with that change.
Jason