aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
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
commitfbce0e1d582f10d890111d8d27f6e88055be6422 (patch)
treee595abf22036651b28621fde6bf784acce90ff93 /lib/Sema/SemaDecl.cpp
parent5f1e0942a32657b625702aa52f82430d0120f424 (diff)
It turns out that this template is only instantiated at one type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111908 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 2f7f54a080..506581a53c 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/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,