From f0218890367901a1e7d4353a7bf61b0099480a0c Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Sun, 27 May 2012 16:59:48 +0000 Subject: -Wdeprecated warning to include reference (as a note) to the declaration in this patch. // rdar://10893232 llvm-svn: 157537 --- clang/lib/Sema/SemaDeclAttr.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'clang/lib/Sema/SemaDeclAttr.cpp') 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(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); -- cgit v1.2.3