Make #pragma unused work for static local variables.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118500 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaAttr.cpp b/lib/Sema/SemaAttr.cpp
index d7290c3..02b8289 100644
--- a/lib/Sema/SemaAttr.cpp
+++ b/lib/Sema/SemaAttr.cpp
@@ -282,7 +282,7 @@
}
VarDecl *VD = Lookup.getAsSingle<VarDecl>();
- if (!VD || !VD->hasLocalStorage()) {
+ if (!VD || !(VD->hasLocalStorage() || VD->isStaticLocal())) {
Diag(PragmaLoc, diag::warn_pragma_unused_expected_localvar)
<< Name << SourceRange(Tok.getLocation());
continue;