Add support for attribute(deprecated), patch by Nuno Lopes!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47753 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Sema/SemaExpr.cpp b/Sema/SemaExpr.cpp
index 3d60866..5b5b2d2 100644
--- a/Sema/SemaExpr.cpp
+++ b/Sema/SemaExpr.cpp
@@ -100,6 +100,10 @@
}
}
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;