]> granicus.if.org Git - clang/commitdiff
When diagnostics are suppressed (e.g., because of code completion), don't trigger...
authorDouglas Gregor <dgregor@apple.com>
Fri, 4 Mar 2011 23:08:02 +0000 (23:08 +0000)
committerDouglas Gregor <dgregor@apple.com>
Fri, 4 Mar 2011 23:08:02 +0000 (23:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127046 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaDecl.cpp

index e6c459504e2a39871879407fd5d2dd2c77a0df42..b40d4f3e9e1341989977f9e4c188f5683723cb07 100644 (file)
@@ -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<FunctionTemplateDecl>(dcl)) {
       // Since the body is valid, issue any analysis-based warnings that are