diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2010-11-17 19:41:23 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2010-11-17 19:41:23 +0000 |
commit | de2676076ba218b5c09a88ac26dd86cc97a9d02e (patch) | |
tree | 21d82775d5c9a280bb520a8ef355ce14b33253aa /lib/Sema/SemaExpr.cpp | |
parent | 47d512c337d06376d56beeb7eccc7c581ed5ff57 (diff) |
Warn if direct accessing synthesized ivar backing the property in
nonofragile-abi2. Fixes //rdar://8673791
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119543 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index 4728b0d199..277da3b78c 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -1446,9 +1446,15 @@ ExprResult Sema::ActOnIdExpression(Scope *S, if (Ex) return Owned(Ex); // Synthesize ivars lazily if (getLangOptions().ObjCNonFragileABI2) { - if (SynthesizeProvisionalIvar(*this, R, II, NameLoc)) + if (SynthesizeProvisionalIvar(*this, R, II, NameLoc)) { + if (const ObjCPropertyDecl *Property = + canSynthesizeProvisionalIvar(II)) { + Diag(NameLoc, diag::warn_synthesized_ivar_access) << II; + Diag(Property->getLocation(), diag::note_property_declare); + } return ActOnIdExpression(S, SS, Id, HasTrailingLParen, isAddressOfOperand); + } } // for further use, this must be set to false if in class method. IvarLookupFollowUp = getCurMethodDecl()->isInstanceMethod(); |