forked from OSchip/llvm-project
When diagnostics are suppressed (e.g., because of code completion), don't trigger the ExprTemplates.empty() check at the end of a function body
llvm-svn: 127046
This commit is contained in:
parent
9e8963acfd
commit
550b98b1c5
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue