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 | 08a1eb77c5925bf32ee1a5bddde9c81c34334ab9 (patch) | |
tree | 7ad6954c4a5a8b8397bd12eb423eb770671c3180 /clang/lib/Sema/SemaDeclAttr.cpp | |
parent | b210aec64d2b54999a113ad8bb5b7c490b5d1cc8 (diff) | |
download | bcm5719-llvm-08a1eb77c5925bf32ee1a5bddde9c81c34334ab9.tar.gz bcm5719-llvm-08a1eb77c5925bf32ee1a5bddde9c81c34334ab9.zip |
with -Wdeprecated, include a note to its deprecated declaration
location. // rdar://10893232
llvm-svn: 155385
Diffstat (limited to 'clang/lib/Sema/SemaDeclAttr.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDeclAttr.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp index 59c4373190e..861b91420d5 100644 --- a/clang/lib/Sema/SemaDeclAttr.cpp +++ b/clang/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(); |