summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/misc/ArgumentCommentCheck.cpp
diff options
context:
space:
mode:
authorAlexander Kornienko <alexfh@google.com>2014-09-03 14:56:30 +0000
committerAlexander Kornienko <alexfh@google.com>2014-09-03 14:56:30 +0000
commit805b44d12436dc62be5c293af95110f9ded1ca7a (patch)
tree44d5c6a54d7ddb2e211a9131915f9ed166184c67 /clang-tools-extra/clang-tidy/misc/ArgumentCommentCheck.cpp
parente46ca71f0bef9c2a04e08d351dd175dd9cfeda5b (diff)
downloadbcm5719-llvm-805b44d12436dc62be5c293af95110f9ded1ca7a.tar.gz
bcm5719-llvm-805b44d12436dc62be5c293af95110f9ded1ca7a.zip
ClangTidy misc-argument-comment check: don't check arguments to template
parameter packs. Summary: This disables this check for std::bind and similar functions that use parameter packs to forward arguments to a different function. Name of the parameter pack argument doesn't matter. Reviewers: klimek Reviewed By: klimek Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D5168 llvm-svn: 217039
Diffstat (limited to 'clang-tools-extra/clang-tidy/misc/ArgumentCommentCheck.cpp')
-rw-r--r--clang-tools-extra/clang-tidy/misc/ArgumentCommentCheck.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang-tools-extra/clang-tidy/misc/ArgumentCommentCheck.cpp b/clang-tools-extra/clang-tidy/misc/ArgumentCommentCheck.cpp
index 4f7b535bd56..c408c9cabe6 100644
--- a/clang-tools-extra/clang-tidy/misc/ArgumentCommentCheck.cpp
+++ b/clang-tools-extra/clang-tidy/misc/ArgumentCommentCheck.cpp
@@ -119,6 +119,15 @@ void ArgumentCommentCheck::checkCallArgs(ASTContext *Ctx,
IdentifierInfo *II = PVD->getIdentifier();
if (!II)
continue;
+ if (auto Template = Callee->getTemplateInstantiationPattern()) {
+ // Don't warn on arguments for parameters instantiated from template
+ // parameter packs. If we find more arguments than the template definition
+ // has, it also means that they correspond to a parameter pack.
+ if (Template->getNumParams() <= i ||
+ Template->getParamDecl(i)->isParameterPack()) {
+ continue;
+ }
+ }
SourceLocation BeginSLoc, EndSLoc = Args[i]->getLocStart();
if (i == 0)
OpenPOWER on IntegriCloud