summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclAttr.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2012-03-02 21:50:02 +0000
committerFariborz Jahanian <fjahanian@apple.com>2012-03-02 21:50:02 +0000
commit7923ef41e18bf9fd31b2753cb026874001c36eb0 (patch)
tree30d65e1f685173b60030f16494633e07d997bec5 /clang/lib/Sema/SemaDeclAttr.cpp
parenta748664c9d8e0aa7c12b141f8fc81304e345be05 (diff)
downloadbcm5719-llvm-7923ef41e18bf9fd31b2753cb026874001c36eb0.tar.gz
bcm5719-llvm-7923ef41e18bf9fd31b2753cb026874001c36eb0.zip
objc: When issue diagnostic about deprecated method, also
issue the note if it is because message is sent to a forward class declaration in delayed diagnostic. // rdar://10290322 llvm-svn: 151942
Diffstat (limited to 'clang/lib/Sema/SemaDeclAttr.cpp')
-rw-r--r--clang/lib/Sema/SemaDeclAttr.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp
index 4f3b03f6e51..37edeff0ecd 100644
--- a/clang/lib/Sema/SemaDeclAttr.cpp
+++ b/clang/lib/Sema/SemaDeclAttr.cpp
@@ -4121,6 +4121,11 @@ void Sema::HandleDelayedDeprecationCheck(DelayedDiagnostic &DD,
Diag(DD.Loc, diag::warn_deprecated_message)
<< DD.getDeprecationDecl()->getDeclName()
<< DD.getDeprecationMessage();
+ else if (DD.getUnknownObjCClass()) {
+ Diag(DD.Loc, diag::warn_deprecated_fwdclass_message)
+ << DD.getDeprecationDecl()->getDeclName();
+ Diag(DD.getUnknownObjCClass()->getLocation(), diag::note_forward_class);
+ }
else
Diag(DD.Loc, diag::warn_deprecated)
<< DD.getDeprecationDecl()->getDeclName();
@@ -4131,7 +4136,9 @@ void Sema::EmitDeprecationWarning(NamedDecl *D, StringRef Message,
const ObjCInterfaceDecl *UnknownObjCClass) {
// Delay if we're currently parsing a declaration.
if (DelayedDiagnostics.shouldDelayDiagnostics()) {
- DelayedDiagnostics.add(DelayedDiagnostic::makeDeprecation(Loc, D, Message));
+ DelayedDiagnostics.add(DelayedDiagnostic::makeDeprecation(Loc, D,
+ UnknownObjCClass,
+ Message));
return;
}
OpenPOWER on IntegriCloud