diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2012-08-06 23:50:51 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2012-08-06 23:50:51 +0000 |
commit | c69d7356caa9dd08cd957f1a4a263da62eae5bc1 (patch) | |
tree | ae0c29f7c9b5cf878a90df30a443c898f4e23762 /lib/Sema/SemaExpr.cpp | |
parent | 8a90393e7ca61d9753cb9a2f2bc64b2669393ffb (diff) |
objective-c: Implement gcc's -Wdirect-ivar-access option.
// rdar://6505197
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161362 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index ea121b8b3c..e8ba54d24f 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -1961,6 +1961,9 @@ Sema::LookupInObjCMethod(LookupResult &Lookup, Scope *S, return ExprError(); MarkAnyDeclReferenced(Loc, IV); + if (IV->getType()->isObjCObjectPointerType() && + getLangOpts().getGC() == LangOptions::NonGC) + Diag(Loc, diag::warn_direct_ivar_access) << IV->getDeclName(); return Owned(new (Context) ObjCIvarRefExpr(IV, IV->getType(), Loc, SelfExpr.take(), true, true)); |