forked from OSchip/llvm-project
attribute "unused" also applies to functions.
llvm-svn: 54440
This commit is contained in:
parent
c3b4c52a4d
commit
955516e6c7
|
@ -346,11 +346,9 @@ static void HandleUnusedAttr(Decl *d, const AttributeList &Attr, Sema &S) {
|
|||
return;
|
||||
}
|
||||
|
||||
VarDecl *VD = dyn_cast<VarDecl>(d);
|
||||
|
||||
if (!VD) {
|
||||
if (!isa<VarDecl>(d) && !getFunctionProto(d)) {
|
||||
S.Diag(Attr.getLoc(), diag::warn_attribute_wrong_decl_type,
|
||||
"unused", "variable");
|
||||
"unused", "variable and function");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue