[cfe-commits] r127046 - /cfe/trunk/lib/Sema/SemaDecl.cpp
Douglas Gregor
dgregor at apple.com
Fri Mar 4 15:08:02 PST 2011
Author: dgregor
Date: Fri Mar 4 17:08:02 2011
New Revision: 127046
URL: http://llvm.org/viewvc/llvm-project?rev=127046&view=rev
Log:
When diagnostics are suppressed (e.g., because of code completion), don't trigger the ExprTemplates.empty() check at the end of a function body
Modified:
cfe/trunk/lib/Sema/SemaDecl.cpp
Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=127046&r1=127045&r2=127046&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Fri Mar 4 17:08:02 2011
@@ -5697,7 +5697,8 @@
// 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
More information about the cfe-commits
mailing list