summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/SemaDeclAttr.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp
index bc1c3afbe21..4175ec1a26e 100644
--- a/clang/lib/Sema/SemaDeclAttr.cpp
+++ b/clang/lib/Sema/SemaDeclAttr.cpp
@@ -4489,8 +4489,12 @@ void Sema::EmitDeprecationWarning(NamedDecl *D, StringRef Message,
: diag::note_previous_decl) << D->getDeclName();
}
else {
- if (!UnknownObjCClass)
+ if (!UnknownObjCClass) {
Diag(Loc, diag::warn_deprecated) << D->getDeclName();
+ Diag(D->getLocation(),
+ isa<ObjCMethodDecl>(D) ? diag::note_method_declared_at
+ : diag::note_previous_decl) << D->getDeclName();
+ }
else {
Diag(Loc, diag::warn_deprecated_fwdclass_message) << D->getDeclName();
Diag(UnknownObjCClass->getLocation(), diag::note_forward_class);
OpenPOWER on IntegriCloud