diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index 74c0e01705905..d0ba12fe80f9a 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -17008,10 +17008,10 @@ Sema::VerifyIntegerConstantExpression(Expr *E, llvm::APSInt *Result, if (!isa(E)) E = Result ? ConstantExpr::Create(Context, E, APValue(*Result)) : ConstantExpr::Create(Context, E); - + if (Notes.empty()) return E; - + // If our only note is the usual "invalid subexpression" note, just point // the caret at its location rather than producing an essentially // redundant note. @@ -17020,7 +17020,7 @@ Sema::VerifyIntegerConstantExpression(Expr *E, llvm::APSInt *Result, DiagLoc = Notes[0].first; Notes.clear(); } - + if (getLangOpts().CPlusPlus) { if (!Diagnoser.Suppress) { Diagnoser.diagnoseNotICE(*this, DiagLoc) << E->getSourceRange(); @@ -17033,7 +17033,7 @@ Sema::VerifyIntegerConstantExpression(Expr *E, llvm::APSInt *Result, Diagnoser.diagnoseFold(*this, DiagLoc) << E->getSourceRange(); for (const PartialDiagnosticAt &Note : Notes) Diag(Note.first, Note.second); - + return E; }