summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index ef21a2719b6..d54a8582210 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -57,8 +57,10 @@ using namespace sema;
///
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
OpenPOWER on IntegriCloud