diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2014-06-16 17:25:41 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2014-06-16 17:25:41 +0000 |
commit | 89ea9610b3061c4a897fedbe3bec319723e43066 (patch) | |
tree | 67aa0fb4a5357f16efb9c1bbda4c4d503606f12e /clang/lib/Sema/SemaExpr.cpp | |
parent | fff5663d4864a20633b3f86efb2b437de54a4dc7 (diff) | |
download | bcm5719-llvm-89ea9610b3061c4a897fedbe3bec319723e43066.tar.gz bcm5719-llvm-89ea9610b3061c4a897fedbe3bec319723e43066.zip |
Objective-C. Diagnose when property access is using declared
property accessor methods which have become deprecated
or available. // rdar://15951801
llvm-svn: 211039
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index 4c329d925f6..0e1aadefe73 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -83,7 +83,8 @@ static void DiagnoseUnusedOfDecl(Sema &S, NamedDecl *D, SourceLocation Loc) { static AvailabilityResult DiagnoseAvailabilityOfDecl(Sema &S, NamedDecl *D, SourceLocation Loc, - const ObjCInterfaceDecl *UnknownObjCClass) { + const ObjCInterfaceDecl *UnknownObjCClass, + bool ObjCPropertyAccess) { // See if this declaration is unavailable or deprecated. std::string Message; AvailabilityResult Result = D->getAvailability(&Message); @@ -113,13 +114,15 @@ static AvailabilityResult DiagnoseAvailabilityOfDecl(Sema &S, case AR_Deprecated: if (S.getCurContextAvailability() != AR_Deprecated) S.EmitAvailabilityWarning(Sema::AD_Deprecation, - D, Message, Loc, UnknownObjCClass, ObjCPDecl); + D, Message, Loc, UnknownObjCClass, ObjCPDecl, + ObjCPropertyAccess); break; case AR_Unavailable: if (S.getCurContextAvailability() != AR_Unavailable) S.EmitAvailabilityWarning(Sema::AD_Unavailable, - D, Message, Loc, UnknownObjCClass, ObjCPDecl); + D, Message, Loc, UnknownObjCClass, ObjCPDecl, + ObjCPropertyAccess); break; } @@ -251,7 +254,8 @@ void Sema::MaybeSuggestAddingStaticToDecl(const FunctionDecl *Cur) { /// referenced), false otherwise. /// bool Sema::DiagnoseUseOfDecl(NamedDecl *D, SourceLocation Loc, - const ObjCInterfaceDecl *UnknownObjCClass) { + const ObjCInterfaceDecl *UnknownObjCClass, + bool ObjCPropertyAccess) { if (getLangOpts().CPlusPlus && isa<FunctionDecl>(D)) { // If there were any diagnostics suppressed by template argument deduction, // emit them now. @@ -296,7 +300,7 @@ bool Sema::DiagnoseUseOfDecl(NamedDecl *D, SourceLocation Loc, DeduceReturnType(FD, Loc)) return true; } - DiagnoseAvailabilityOfDecl(*this, D, Loc, UnknownObjCClass); + DiagnoseAvailabilityOfDecl(*this, D, Loc, UnknownObjCClass, ObjCPropertyAccess); DiagnoseUnusedOfDecl(*this, D, Loc); |