aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2011-12-07 00:30:00 +0000
committerFariborz Jahanian <fjahanian@apple.com>2011-12-07 00:30:00 +0000
commitb76a97e91dc4bea0b6b3da06c84e02f50cd351d3 (patch)
tree943d7f63c900ccaca5195f0e67f859ec45a087af /lib/Sema/SemaExpr.cpp
parent0e35b4ecee380c2b4c33d75da6bc2fb6f6bc7df3 (diff)
objc: issue deprecated/unavailable diagnostic when
methods with these attributes are sent to receivers of 'id' type too. // rdar://10459930 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145999 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r--lib/Sema/SemaExpr.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index cc94050a6f..aeae6666dc 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -62,7 +62,8 @@ bool Sema::CanUseDecl(NamedDecl *D) {
return true;
}
-static AvailabilityResult DiagnoseAvailabilityOfDecl(Sema &S,
+AvailabilityResult
+Sema::DiagnoseAvailabilityOfDecl(
NamedDecl *D, SourceLocation Loc,
const ObjCInterfaceDecl *UnknownObjCClass) {
// See if this declaration is unavailable or deprecated.
@@ -81,22 +82,22 @@ static AvailabilityResult DiagnoseAvailabilityOfDecl(Sema &S,
break;
case AR_Deprecated:
- S.EmitDeprecationWarning(D, Message, Loc, UnknownObjCClass);
+ EmitDeprecationWarning(D, Message, Loc, UnknownObjCClass);
break;
case AR_Unavailable:
- if (S.getCurContextAvailability() != AR_Unavailable) {
+ if (getCurContextAvailability() != AR_Unavailable) {
if (Message.empty()) {
if (!UnknownObjCClass)
- S.Diag(Loc, diag::err_unavailable) << D->getDeclName();
+ Diag(Loc, diag::err_unavailable) << D->getDeclName();
else
- S.Diag(Loc, diag::warn_unavailable_fwdclass_message)
+ Diag(Loc, diag::warn_unavailable_fwdclass_message)
<< D->getDeclName();
}
else
- S.Diag(Loc, diag::err_unavailable_message)
+ Diag(Loc, diag::err_unavailable_message)
<< D->getDeclName() << Message;
- S.Diag(D->getLocation(), diag::note_unavailable_here)
+ Diag(D->getLocation(), diag::note_unavailable_here)
<< isa<FunctionDecl>(D) << false;
}
break;
@@ -151,7 +152,7 @@ bool Sema::DiagnoseUseOfDecl(NamedDecl *D, SourceLocation Loc,
return true;
}
}
- DiagnoseAvailabilityOfDecl(*this, D, Loc, UnknownObjCClass);
+ DiagnoseAvailabilityOfDecl(D, Loc, UnknownObjCClass);
// Warn if this is used but marked unused.
if (D->hasAttr<UnusedAttr>())