diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp --- a/clang/lib/AST/ExprConstant.cpp +++ b/clang/lib/AST/ExprConstant.cpp @@ -2439,7 +2439,8 @@ return false; } - if (St & APFloat::opStatus::opInvalidOp) { + if ((St & APFloat::opStatus::opInvalidOp) && + FPO.getFPExceptionMode() != LangOptions::FPE_Ignore) { // There is no usefully definable result. Info.FFDiag(E); return false;