This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Update RedundantVoidArgCheck to check for type aliases in addition to typedefs
ClosedPublic

Authored by courbet on Apr 14 2016, 8:22 AM.

Details

Summary

RedundantVoidArgCheck will now warn on:

using f_t = int (*(void))(void);

too.

(Depends on http://reviews.llvm.org/D19113)

Diff Detail

Event Timeline

courbet updated this revision to Diff 53726.Apr 14 2016, 8:22 AM
courbet retitled this revision from to [clang-tidy] Update RedundantVoidArgCheck to check for type aliases in addition to typedefs.
courbet updated this object.
courbet added a subscriber: cfe-commits.
aaron.ballman added a subscriber: aaron.ballman.
aaron.ballman added inline comments.
clang-tidy/modernize/RedundantVoidArgCheck.cpp
109–111

Is this a drive-by formatting fix from clang-format?

187

Use of "typedef" is incorrect here, it should probably be "typedef" or "type alias", depending on the results of an isa<> test.

courbet marked an inline comment as done.Apr 14 2016, 8:47 AM
courbet added inline comments.
clang-tidy/modernize/RedundantVoidArgCheck.cpp
109–111

Yes. What's the policy here (I'm a new contributor) ? Should I not touch it ?

courbet updated this revision to Diff 53735.Apr 14 2016, 8:48 AM
courbet edited edge metadata.

Fix error message in case of type alias declaration.

aaron.ballman accepted this revision.Apr 14 2016, 9:08 AM
aaron.ballman edited edge metadata.

LGTM, thank you for working on this! I can submit the patch on your behalf if you would like.

clang-tidy/modernize/RedundantVoidArgCheck.cpp
109–111

Generally, you run clang-format just over the patch so that you're only formatting the code you've touched. However, if you ran clang-format over the entire file and this is the only change it produced, I think it's fine as a drive-by. If it produced more changes, then I would say submit all of the formatting changes as a secondary patch.

This revision is now accepted and ready to land.Apr 14 2016, 9:08 AM

Thanks for the review !

I can submit the patch on your behalf if you would like.

That'd be great, thank you.

clang-tidy/modernize/RedundantVoidArgCheck.cpp
109–111

Thanks, that's what I though. The test file had a ton of reformatting changes, so I left it out.

Commit in r266358