[PATCH] ClangTidy misc-argument-comment check: don't check arguments to templateparameter packs.

Alexander Kornienko alexfh at google.com
Wed Sep 3 08:06:29 PDT 2014


================
Comment at: clang-tidy/misc/ArgumentCommentCheck.cpp:123
@@ +122,3 @@
+    if (auto Template = Callee->getTemplateInstantiationPattern()) {
+      if (Template->getNumParams() <= i ||
+          Template->getParamDecl(i)->isParameterPack()) {
----------------
klimek wrote:
> alexfh wrote:
> > klimek wrote:
> > > Can that one actually happen? Shouldn't that be an assert?
> > Sure it can. We're looking at template parameter packs here, which can then instantiate to multiple parameters.
> > 
> > This is tested by the "variadic2(/*zzZ=*/0, /*xxx=*/1, /*yyy=*/2);" line. The last argument of it.
> Ah, because this is the function definition, which doesn't know how many parameters are actually given. Perhaps add a comment?
Added a comment.

http://reviews.llvm.org/D5168






More information about the cfe-commits mailing list