diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2012-10-03 17:55:29 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2012-10-03 17:55:29 +0000 |
commit | 3f001ff471aec590a65a383a25367a4e1c82f5a3 (patch) | |
tree | 7871f14177a640a2379870c0683a27f351711405 /lib/Sema/SemaExpr.cpp | |
parent | f8d9bd546811a56ebb0b581ce4cc6043b51659a1 (diff) |
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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165133 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index 75bc8658c6..bbae55b598 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/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); |