diff options
Diffstat (limited to 'clang-tools-extra/clang-tidy/misc/ArgumentCommentCheck.cpp')
-rw-r--r-- | clang-tools-extra/clang-tidy/misc/ArgumentCommentCheck.cpp | 9 |
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) |