Add message to attribute(deprecated).
attribute(unavailable) to do next.
// rdar:// 6734520.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115842 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index ef21a27..d54a858 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -57,8 +57,10 @@
///
bool Sema::DiagnoseUseOfDecl(NamedDecl *D, SourceLocation Loc) {
// See if the decl is deprecated.
- if (D->getAttr<DeprecatedAttr>()) {
- EmitDeprecationWarning(D, Loc);
+ if (const DeprecatedAttr *DA = D->getAttr<DeprecatedAttr>()) {
+ const char *Message =
+ DA->getMessage().empty() ? "" : DA->getMessage().data();
+ EmitDeprecationWarning(D, Message, Loc);
}
// See if the decl is unavailable