aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-04-09 17:25:05 +0000
committerChris Lattner <sabre@nondot.org>2010-04-09 17:25:05 +0000
commit1a4221cbe1912421ed7e29d0bbac39e9792af8a2 (patch)
treefbaa40c7340bf6478cf6e46ab8fcdb618469e67e /lib/Sema/SemaDecl.cpp
parent9f692a0308975cf24ef117c05e31284a1a944e86 (diff)
Don't warn about unused static functions if they are marked with
attr constructor or destructor. Patch by Jean-Daniel Dupas! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100870 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 9d0d7ad133..7475ae4fbe 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -3318,7 +3318,9 @@ 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->hasAttr<UnusedAttr>())
+ && !NewFD->isUsed() && !NewFD->hasAttr<UnusedAttr>()
+ && !NewFD->hasAttr<ConstructorAttr>()
+ && !NewFD->hasAttr<DestructorAttr>())
UnusedStaticFuncs.push_back(NewFD);
return NewFD;