From: Douglas Gregor Date: Fri, 4 Mar 2011 23:08:02 +0000 (+0000) Subject: When diagnostics are suppressed (e.g., because of code completion), don't trigger... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=26cd44da98f3c5293243020b4cdfa7f49f68d1be;p=clang When diagnostics are suppressed (e.g., because of code completion), don't trigger the ExprTemplates.empty() check at the end of a function body git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127046 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index e6c459504e..b40d4f3e9e 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -5697,7 +5697,8 @@ Decl *Sema::ActOnFinishFunctionBody(Decl *dcl, Stmt *Body, // If any errors have occurred, clear out any temporaries that may have // been leftover. This ensures that these temporaries won't be picked up for // deletion in some later function. - if (PP.getDiagnostics().hasErrorOccurred()) + if (PP.getDiagnostics().hasErrorOccurred() || + PP.getDiagnostics().getSuppressAllDiagnostics()) ExprTemporaries.clear(); else if (!isa(dcl)) { // Since the body is valid, issue any analysis-based warnings that are