[clang-tools-extra] r259640 - clang-tidy: [misc-unused-parameters] Ignore template instantiations.
Daniel Jasper via cfe-commits
cfe-commits at lists.llvm.org
Wed Feb 3 03:33:19 PST 2016
Author: djasper
Date: Wed Feb 3 05:33:18 2016
New Revision: 259640
URL: http://llvm.org/viewvc/llvm-project?rev=259640&view=rev
Log:
clang-tidy: [misc-unused-parameters] Ignore template instantiations.
No functional changes intended as we should already do the
corresponding fixes when visiting the primary template. There are
existing tests that verify that we do change unused parameters of
templated functions.
Modified:
clang-tools-extra/trunk/clang-tidy/misc/UnusedParametersCheck.cpp
Modified: clang-tools-extra/trunk/clang-tidy/misc/UnusedParametersCheck.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/misc/UnusedParametersCheck.cpp?rev=259640&r1=259639&r2=259640&view=diff
==============================================================================
--- clang-tools-extra/trunk/clang-tidy/misc/UnusedParametersCheck.cpp (original)
+++ clang-tools-extra/trunk/clang-tidy/misc/UnusedParametersCheck.cpp Wed Feb 3 05:33:18 2016
@@ -104,7 +104,8 @@ void UnusedParametersCheck::warnOnUnused
void UnusedParametersCheck::check(const MatchFinder::MatchResult &Result) {
const auto *Function = Result.Nodes.getNodeAs<FunctionDecl>("function");
if (!Function->doesThisDeclarationHaveABody() ||
- !Function->hasWrittenPrototype())
+ !Function->hasWrittenPrototype() ||
+ Function->isTemplateInstantiation())
return;
if (const auto *Method = dyn_cast<CXXMethodDecl>(Function))
if (Method->isLambdaStaticInvoker())
More information about the cfe-commits
mailing list