summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2013-02-14 19:07:19 +0000
committerFariborz Jahanian <fjahanian@apple.com>2013-02-14 19:07:19 +0000
commita934a022af67bf1ed04db7b7d4f2eb1842bf94e4 (patch)
treed4bdf02061433d47dcc89d1775ec7458152879ae /clang/lib/Sema/SemaExpr.cpp
parentba4a6d10e0d6cf703d4beedc57bdb5e30abf0181 (diff)
downloadbcm5719-llvm-a934a022af67bf1ed04db7b7d4f2eb1842bf94e4.tar.gz
bcm5719-llvm-a934a022af67bf1ed04db7b7d4f2eb1842bf94e4.zip
objective-C: When implementing custom accessor method for
a property, the -Wdirect-ivar-access should not warn when accessing the property's synthesized instance variable. // rdar://13142820 llvm-svn: 175195
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index b3ba2dc4ae9..0ed460cc5e2 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -2042,7 +2042,8 @@ Sema::LookupInObjCMethod(LookupResult &Lookup, Scope *S,
MarkAnyDeclReferenced(Loc, IV, true);
ObjCMethodFamily MF = CurMethod->getMethodFamily();
- if (MF != OMF_init && MF != OMF_dealloc && MF != OMF_finalize)
+ if (MF != OMF_init && MF != OMF_dealloc && MF != OMF_finalize &&
+ !IvarBacksCurrentMethodAccessor(IFace, CurMethod, IV))
Diag(Loc, diag::warn_direct_ivar_access) << IV->getDeclName();
ObjCIvarRefExpr *Result = new (Context) ObjCIvarRefExpr(IV, IV->getType(),
OpenPOWER on IntegriCloud