diff options
Diffstat (limited to 'lib/Sema/SemaChecking.cpp')
-rw-r--r-- | lib/Sema/SemaChecking.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp index f3bc273d99..708fd14e49 100644 --- a/lib/Sema/SemaChecking.cpp +++ b/lib/Sema/SemaChecking.cpp @@ -5233,7 +5233,7 @@ bool Sema::checkUnsafeAssigns(SourceLocation Loc, while (ImplicitCastExpr *cast = dyn_cast<ImplicitCastExpr>(RHS)) { if (cast->getCastKind() == CK_ARCConsumeObject) { Diag(Loc, diag::warn_arc_retained_assign) - << (LT == Qualifiers::OCL_ExplicitNone) + << (LT == Qualifiers::OCL_ExplicitNone) << 1 << RHS->getSourceRange(); return true; } @@ -5290,6 +5290,16 @@ void Sema::checkUnsafeExprAssigns(SourceLocation Loc, RHS = cast->getSubExpr(); } } + else if (Attributes & ObjCPropertyDecl::OBJC_PR_weak) { + while (ImplicitCastExpr *cast = dyn_cast<ImplicitCastExpr>(RHS)) { + if (cast->getCastKind() == CK_ARCConsumeObject) { + Diag(Loc, diag::warn_arc_retained_assign) + << 0 << 0<< RHS->getSourceRange(); + return; + } + RHS = cast->getSubExpr(); + } + } } } |