This is an archive of the discontinued LLVM Phabricator instance.

Rename EM_ConstantExpressionUnevaluated to EM_ConstantFoldUnevaluated, which is actually what the code is currently doing.
Needs ReviewPublic

Authored by jyknight on Oct 4 2018, 10:48 PM.

Details

Reviewers
rsmith
Summary

And, configure it to explicitly request equivalent behavior to
ConstantFold, instead of getting that behavior accidentally.

While it seems that diagnose_if and enable_if were intended to require
a constexpr argument, the code was actually only checking whether it
could be constant-folded, due to the confusing way the constant
evaluator code currently works.

It _probably_ should be fixed to actually check for
constexpr-ness. However, r290584 now depends on it NOT doing so -- and
it's possible that some users are, too.

I'd like to land this, to unblock the follow-on cleanup -- without
changing the semantics first -- and maybe loop back to convert it to
require a constexpr later, if it looks like users aren't depending on
the semantics it has now.

This change is a prerequisite for fixing the confusion in the
ExprConstant code which led to this situation.