summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2012-10-03 17:55:29 +0000
committerFariborz Jahanian <fjahanian@apple.com>2012-10-03 17:55:29 +0000
commit4a67508685abee7b8d3ebbca6b1144d2c7ead211 (patch)
treec4960b19093dfdbdd8d2dc4091f6e1af20d32314 /clang/lib/Sema/SemaExpr.cpp
parent8baa61d85d3faa05882e5a6b45bcc11c78f60d40 (diff)
downloadbcm5719-llvm-4a67508685abee7b8d3ebbca6b1144d2c7ead211.tar.gz
bcm5719-llvm-4a67508685abee7b8d3ebbca6b1144d2c7ead211.zip
objective-C arc: Warn under arc about a use of an ivar inside a block
that doesn't have a 'self' as this implicitly captures 'self' and could create retain cycles. Provide fixit. // rdar://11194874 llvm-svn: 165133
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index 75bc8658c65..bbae55b5980 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -2008,6 +2008,9 @@ Sema::LookupInObjCMethod(LookupResult &Lookup, Scope *S,
if (Level != DiagnosticsEngine::Ignored)
getCurFunction()->recordUseOfWeak(Result);
}
+ if (CurContext->isClosure())
+ Diag(Loc, diag::warn_implicitly_retains_self)
+ << FixItHint::CreateInsertion(Loc, "self->");
}
return Owned(Result);
OpenPOWER on IntegriCloud