diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2012-04-23 20:30:52 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2012-04-23 20:30:52 +0000 |
commit | d6724367519b4f98dcce091854549282c11d70a0 (patch) | |
tree | aa30a4e8e944f3723cb2b29ad7ef33e5578a3580 /lib/Sema/SemaDeclAttr.cpp | |
parent | 87380aaf4273b2259fa75790f2f544c4514cc763 (diff) |
with -Wdeprecated, include a note to its deprecated declaration
location. // rdar://10893232
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155385 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclAttr.cpp')
-rw-r--r-- | lib/Sema/SemaDeclAttr.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp index 59c4373190..861b91420d 100644 --- a/lib/Sema/SemaDeclAttr.cpp +++ b/lib/Sema/SemaDeclAttr.cpp @@ -4189,9 +4189,13 @@ void Sema::EmitDeprecationWarning(NamedDecl *D, StringRef Message, // Otherwise, don't warn if our current context is deprecated. if (isDeclDeprecated(cast<Decl>(getCurLexicalContext()))) return; - if (!Message.empty()) + if (!Message.empty()) { Diag(Loc, diag::warn_deprecated_message) << D->getDeclName() << Message; + Diag(D->getLocation(), + isa<ObjCMethodDecl>(D) ? diag::note_method_declared_at + : diag::note_previous_decl) << D->getDeclName(); + } else { if (!UnknownObjCClass) Diag(Loc, diag::warn_deprecated) << D->getDeclName(); |