diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2010-12-21 00:44:01 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2010-12-21 00:44:01 +0000 |
commit | 8e5fc9be37c6828ad008f22730e3baac1bef1686 (patch) | |
tree | ce5d1beabb36370e5dcbecc2cc6a345162aafd49 /lib/Sema/SemaDeclAttr.cpp | |
parent | a04426c5416f22df1078f6b31c1619de73c40b59 (diff) |
Warn when message is sent to receiver of
unknown type and there is a possibility that
at runtime method is resolved to a deprecated or
unavailable method. Addreses // rdar://8769853
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122294 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclAttr.cpp')
-rw-r--r-- | lib/Sema/SemaDeclAttr.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp index e77a660ada..06cb42ec0e 100644 --- a/lib/Sema/SemaDeclAttr.cpp +++ b/lib/Sema/SemaDeclAttr.cpp @@ -2903,7 +2903,8 @@ void Sema::HandleDelayedDeprecationCheck(DelayedDiagnostic &DD, } void Sema::EmitDeprecationWarning(NamedDecl *D, llvm::StringRef Message, - SourceLocation Loc) { + SourceLocation Loc, + bool UnkownObjCClass) { // Delay if we're currently parsing a declaration. if (ParsingDeclDepth) { DelayedDiagnostics.push_back(DelayedDiagnostic::makeDeprecation(Loc, D, @@ -2917,6 +2918,10 @@ void Sema::EmitDeprecationWarning(NamedDecl *D, llvm::StringRef Message, if (!Message.empty()) Diag(Loc, diag::warn_deprecated_message) << D->getDeclName() << Message; - else - Diag(Loc, diag::warn_deprecated) << D->getDeclName(); + else { + if (!UnkownObjCClass) + Diag(Loc, diag::warn_deprecated) << D->getDeclName(); + else + Diag(Loc, diag::warn_deprecated_fwdclass_message) << D->getDeclName(); + } } |