[cfe-commits] r111908 - in /cfe/trunk: include/clang/Sema/Sema.h lib/Sema/SemaDecl.cpp

John McCall rjmccall at apple.com
Tue Aug 24 02:05:15 PDT 2010


Author: rjmccall
Date: Tue Aug 24 04:05:15 2010
New Revision: 111908

URL: http://llvm.org/viewvc/llvm-project?rev=111908&view=rev
Log:
It turns out that this template is only instantiated at one type.


Modified:
    cfe/trunk/include/clang/Sema/Sema.h
    cfe/trunk/lib/Sema/SemaDecl.cpp

Modified: cfe/trunk/include/clang/Sema/Sema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Sema.h?rev=111908&r1=111907&r2=111908&view=diff
==============================================================================
--- cfe/trunk/include/clang/Sema/Sema.h (original)
+++ cfe/trunk/include/clang/Sema/Sema.h Tue Aug 24 04:05:15 2010
@@ -932,25 +932,8 @@
 
   /// \brief Diagnose any unused parameters in the given sequence of
   /// ParmVarDecl pointers.
-  template<typename InputIterator>
-  void DiagnoseUnusedParameters(InputIterator Param, InputIterator ParamEnd) {
-    if (Diags.getDiagnosticLevel(diag::warn_unused_parameter) ==
-          Diagnostic::Ignored)
-      return;
-
-    // Don't diagnose unused-parameter errors in template instantiations; we
-    // will already have done so in the template itself.
-    if (!ActiveTemplateInstantiations.empty())
-      return;
-
-    for (; Param != ParamEnd; ++Param) {
-      if (!(*Param)->isUsed() && (*Param)->getDeclName() &&
-          !(*Param)->template hasAttr<UnusedAttr>()) {
-        Diag((*Param)->getLocation(), diag::warn_unused_parameter)
-          << (*Param)->getDeclName();
-      }
-    }
-  }
+  void DiagnoseUnusedParameters(ParmVarDecl * const *Begin,
+                                ParmVarDecl * const *End);
 
   void DiagnoseInvalidJumps(Stmt *Body);
   virtual Decl *ActOnFileScopeAsmDecl(SourceLocation Loc, ExprArg expr);

Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=111908&r1=111907&r2=111908&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Tue Aug 24 04:05:15 2010
@@ -4626,6 +4626,26 @@
   return Param;
 }
 
+void Sema::DiagnoseUnusedParameters(ParmVarDecl * const *Param,
+                                    ParmVarDecl * const *ParamEnd) {
+  if (Diags.getDiagnosticLevel(diag::warn_unused_parameter) ==
+        Diagnostic::Ignored)
+    return;
+
+  // Don't diagnose unused-parameter errors in template instantiations; we
+  // will already have done so in the template itself.
+  if (!ActiveTemplateInstantiations.empty())
+    return;
+
+  for (; Param != ParamEnd; ++Param) {
+    if (!(*Param)->isUsed() && (*Param)->getDeclName() &&
+        !(*Param)->hasAttr<UnusedAttr>()) {
+      Diag((*Param)->getLocation(), diag::warn_unused_parameter)
+        << (*Param)->getDeclName();
+    }
+  }
+}
+
 ParmVarDecl *Sema::CheckParameter(DeclContext *DC, 
                                   TypeSourceInfo *TSInfo, QualType T,
                                   IdentifierInfo *Name,





More information about the cfe-commits mailing list