aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorTanya Lattner <tonic@nondot.org>2010-02-17 04:48:01 +0000
committerTanya Lattner <tonic@nondot.org>2010-02-17 04:48:01 +0000
commitc777221d22e2687938c061de6698ddcccbe00fdc (patch)
treeee98123433996248bb6d46137ea963674420ab34 /lib/Sema/SemaDecl.cpp
parent92ac9ffecd236a6be0d6ab30cef56100e56b171c (diff)
Do not add functions marked with the unused attribute to the list of unused functions to warn about. Update test case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96452 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 1fc08ce031..3821113439 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -3135,7 +3135,7 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC,
// FIXME: Also include static functions declared but not defined.
if (!NewFD->isInvalidDecl() && IsFunctionDefinition
&& !NewFD->isInlined() && NewFD->getLinkage() == InternalLinkage
- && !NewFD->isUsed())
+ && !NewFD->isUsed() && !NewFD->hasAttr<UnusedAttr>())
UnusedStaticFuncs.push_back(NewFD);
return NewFD;