diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-01-27 18:16:48 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-01-27 18:16:48 +0000 |
commit | 2a5c45b1ae4406459fbb39cb477951987c59cb0f (patch) | |
tree | 0baf0cd8a5a3cc2c1aae1373d32870f594817114 /lib/Sema/SemaAttr.cpp | |
parent | 1aa27307c462baaa9e5fda14ff6797dd39fe8b84 (diff) |
Allow #pragma unused to be used on global variables like gcc. Fixes rdar://8793832.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124383 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaAttr.cpp')
-rw-r--r-- | lib/Sema/SemaAttr.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Sema/SemaAttr.cpp b/lib/Sema/SemaAttr.cpp index a67c4fbbb2..c983199cf9 100644 --- a/lib/Sema/SemaAttr.cpp +++ b/lib/Sema/SemaAttr.cpp @@ -277,8 +277,8 @@ void Sema::ActOnPragmaUnused(const Token &IdTok, Scope *curScope, } VarDecl *VD = Lookup.getAsSingle<VarDecl>(); - if (!VD || !(VD->hasLocalStorage() || VD->isStaticLocal())) { - Diag(PragmaLoc, diag::warn_pragma_unused_expected_localvar) + if (!VD) { + Diag(PragmaLoc, diag::warn_pragma_unused_expected_var_arg) << Name << SourceRange(IdTok.getLocation()); return; } |