-Wunused-private-field.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158411
91177308-0d34-0410-b5e6-
96231b3b80d8
}
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;
// effects and are not part of a dependent type declaration.
if (!FD->isImplicit() && FD->getDeclName() &&
FD->getAccess() == AS_private &&
+ !FD->hasAttr<UnusedAttr>() &&
!FD->getParent()->getTypeForDecl()->isDependentType() &&
!InitializationHasSideEffects(*FD))
UnusedPrivateFields.insert(FD);
Trivial user_constructor_;
NonTrivialConstructor non_trivial_constructor_;
NonTrivialDestructor non_trivial_destructor_;
+
+ int attr_ __attribute__((unused));
};
class EverythingUsed {