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 | 4a67508685abee7b8d3ebbca6b1144d2c7ead211 (patch) | |
tree | c4960b19093dfdbdd8d2dc4091f6e1af20d32314 /clang/lib/Sema/SemaExpr.cpp | |
parent | 8baa61d85d3faa05882e5a6b45bcc11c78f60d40 (diff) | |
download | bcm5719-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.cpp | 3 |
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); |