summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-08-24 09:05:15 +0000
committerJohn McCall <rjmccall@apple.com>2010-08-24 09:05:15 +0000
commitc5990644b05c573772a730ff1a34cb6108a58c60 (patch)
treec83bcca8afb9d9b4e1555648c30d61527bb0cb19
parentcc14d1fd23bb1a4f621f58e6f815b44c84319734 (diff)
downloadbcm5719-llvm-c5990644b05c573772a730ff1a34cb6108a58c60.tar.gz
bcm5719-llvm-c5990644b05c573772a730ff1a34cb6108a58c60.zip
It turns out that this template is only instantiated at one type.
llvm-svn: 111908
-rw-r--r--clang/include/clang/Sema/Sema.h21
-rw-r--r--clang/lib/Sema/SemaDecl.cpp20
2 files changed, 22 insertions, 19 deletions
diff --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h
index 6624ad8475e..c9c4347eb34 100644
--- a/clang/include/clang/Sema/Sema.h
+++ b/clang/include/clang/Sema/Sema.h
@@ -932,25 +932,8 @@ public:
/// \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);
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 2f7f54a080c..506581a53cb 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -4626,6 +4626,26 @@ ParmVarDecl *Sema::BuildParmVarDeclForTypedef(DeclContext *DC,
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,
OpenPOWER on IntegriCloud