aboutsummaryrefslogtreecommitdiff
path: root/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
commit3f001ff471aec590a65a383a25367a4e1c82f5a3 (patch)
tree7871f14177a640a2379870c0683a27f351711405 /lib/Sema/SemaExpr.cpp
parentf8d9bd546811a56ebb0b581ce4cc6043b51659a1 (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.cpp3
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);