Introduce -Wunused-method option for warning on unused class methods in anonymous namespace.

This option is not part of the Unused diagnostic group until the warnings on llvm codebase are fixed
and we are ready to turn it on. Suggestion by Daniel.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111298 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/Sema.cpp b/lib/Sema/Sema.cpp
index 0a85252..92e3fdd 100644
--- a/lib/Sema/Sema.cpp
+++ b/lib/Sema/Sema.cpp
@@ -376,7 +376,9 @@
       const FunctionDecl *DiagD;
       if (!FD->hasBody(DiagD))
         DiagD = FD;
-      Diag(DiagD->getLocation(), diag::warn_unused_function)
+      Diag(DiagD->getLocation(),
+           isa<CXXMethodDecl>(DiagD) ? diag::warn_unused_method
+                                     : diag::warn_unused_function)
             << DiagD->getDeclName();
     } else {
       const VarDecl *DiagD = cast<VarDecl>(*I)->getDefinition();