Index: clang/lib/AST/ExprConstant.cpp =================================================================== --- clang/lib/AST/ExprConstant.cpp +++ clang/lib/AST/ExprConstant.cpp @@ -15206,6 +15206,17 @@ return true; } + if (const auto *CE = dyn_cast(Exp)) { + if (CE->hasAPValueResult()) { + Result.Val = CE->getAPValueResult(); + IsConst = true; + return true; + } + + // The SubExpr is usually just an IntegerLiteral. + return FastEvaluateAsRValue(CE->getSubExpr(), Result, Ctx, IsConst); + } + // This case should be rare, but we need to check it before we check on // the type below. if (Exp->getType().isNull()) {