summaryrefslogtreecommitdiffstats
path: root/clang/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/Sema/SemaExpr.cpp')
-rw-r--r--clang/Sema/SemaExpr.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/Sema/SemaExpr.cpp b/clang/Sema/SemaExpr.cpp
index 3d60866c015..5b5b2d235ce 100644
--- a/clang/Sema/SemaExpr.cpp
+++ b/clang/Sema/SemaExpr.cpp
@@ -100,6 +100,10 @@ Sema::ExprResult Sema::ActOnIdentifierExpr(Scope *S, SourceLocation Loc,
}
}
if (ValueDecl *VD = dyn_cast<ValueDecl>(D)) {
+ // check if referencing an identifier with __attribute__((deprecated)).
+ if (VD->getAttr<DeprecatedAttr>())
+ Diag(Loc, diag::warn_deprecated, VD->getName());
+
// Only create DeclRefExpr's for valid Decl's.
if (VD->isInvalidDecl())
return true;
OpenPOWER on IntegriCloud