aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDeclAttr.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2012-06-13 18:31:09 +0000
committerDaniel Jasper <djasper@google.com>2012-06-13 18:31:09 +0000
commit568eae48a4e19c0359cdcd2a33b8ec9812e4abbc (patch)
treefcd4ec3532953cc1c6c3b6795d2d6a37e5c9ae03 /lib/Sema/SemaDeclAttr.cpp
parent28e862a4fbb9ed4060d1db25d45b1ed7a42f1b75 (diff)
Allow __attribute__((unused)) for fields and make it silence
-Wunused-private-field. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158411 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclAttr.cpp')
-rw-r--r--lib/Sema/SemaDeclAttr.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp
index 19ac6160c5..cf17af0341 100644
--- a/lib/Sema/SemaDeclAttr.cpp
+++ b/lib/Sema/SemaDeclAttr.cpp
@@ -1610,7 +1610,7 @@ static void handleUnusedAttr(Sema &S, Decl *D, const AttributeList &Attr) {
}
if (!isa<VarDecl>(D) && !isa<ObjCIvarDecl>(D) && !isFunctionOrMethod(D) &&
- !isa<TypeDecl>(D) && !isa<LabelDecl>(D)) {
+ !isa<TypeDecl>(D) && !isa<LabelDecl>(D) && !isa<FieldDecl>(D)) {
S.Diag(Attr.getLoc(), diag::warn_attribute_wrong_decl_type)
<< Attr.getName() << ExpectedVariableFunctionOrLabel;
return;