The following code is accepted by Clang 7 and prior but rejected by the upcoming 8 release and in trunk [1]
// error {{never produces a constant expression}} void foo(const char* s) __attribute__((enable_if(__builtin_constant_p(*s) == false, "trap"))) {} void test() { foo("abc"); }
Prior to Clang 8, the call to __builtin_constant_p was a constant expression returning false. Currently, it's not a valid constant expression.
The bug is caused because we failed to set InConstantContext when attempting to evaluate unevaluated constant expressions.