This is an archive of the discontinued LLVM Phabricator instance.

ClangTidy misc-argument-comment check: don't check arguments to template parameter packs.
ClosedPublic

Authored by alexfh on Sep 3 2014, 5:57 AM.

Details

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.

Diff Detail

Event Timeline

alexfh updated this revision to Diff 13202.Sep 3 2014, 5:57 AM
alexfh retitled this revision from to ClangTidy misc-argument-comment check: don't check arguments to template parameter packs..
alexfh updated this object.
alexfh edited the test plan for this revision. (Show Details)
alexfh added a reviewer: klimek.
alexfh added a subscriber: Unknown Object (MLST).
klimek added inline comments.Sep 3 2014, 6:20 AM
clang-tidy/misc/ArgumentCommentCheck.cpp
123

Can that one actually happen? Shouldn't that be an assert?

alexfh added inline comments.Sep 3 2014, 6:26 AM
clang-tidy/misc/ArgumentCommentCheck.cpp
123

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.

klimek accepted this revision.Sep 3 2014, 6:29 AM
klimek edited edge metadata.

lg

clang-tidy/misc/ArgumentCommentCheck.cpp
123

Ah, because this is the function definition, which doesn't know how many parameters are actually given. Perhaps add a comment?

This revision is now accepted and ready to land.Sep 3 2014, 6:29 AM
alexfh closed this revision.Sep 3 2014, 8:05 AM
alexfh added inline comments.Sep 3 2014, 8:06 AM
clang-tidy/misc/ArgumentCommentCheck.cpp
123

Added a comment.