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
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 1fc08ce..3821113 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -3135,7 +3135,7 @@
   // 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;