[cfe-commits] r54440 - /cfe/trunk/lib/Sema/SemaDeclAttr.cpp
Ted Kremenek
kremenek at apple.com
Wed Aug 6 18:02:06 PDT 2008
Author: kremenek
Date: Wed Aug 6 20:02:05 2008
New Revision: 54440
URL: http://llvm.org/viewvc/llvm-project?rev=54440&view=rev
Log:
attribute "unused" also applies to functions.
Modified:
cfe/trunk/lib/Sema/SemaDeclAttr.cpp
Modified: cfe/trunk/lib/Sema/SemaDeclAttr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclAttr.cpp?rev=54440&r1=54439&r2=54440&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclAttr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclAttr.cpp Wed Aug 6 20:02:05 2008
@@ -346,11 +346,9 @@
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;
}
More information about the cfe-commits
mailing list