You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
734 B

--- a/llvm/tools/clang/lib/Sema/SemaInit.cpp
+++ b/llvm/tools/clang/lib/Sema/SemaInit.cpp
@@ -7147,7 +7147,9 @@ void Sema::checkInitializerLifetime(const InitializedEntity &Entity,
<< Entity.getType()->isReferenceType() << DRE->getDecl()
<< isa<ParmVarDecl>(DRE->getDecl()) << DiagRange;
} else if (isa<BlockExpr>(L)) {
- Diag(DiagLoc, diag::err_ret_local_block) << DiagRange;
+ // Don't throw this error during Infer runs
+ // Diag(DiagLoc, diag::err_ret_local_block) << DiagRange;
+ return false;
} else if (isa<AddrLabelExpr>(L)) {
// Don't warn when returning a label from a statement expression.
// Leaving the scope doesn't end its lifetime.