This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] new google-default-arguments check
ClosedPublic

Authored by courbet on Apr 26 2016, 8:24 AM.

Diff Detail

Event Timeline

courbet updated this revision to Diff 55006.Apr 26 2016, 8:24 AM
courbet retitled this revision from to [clang-tidy] new google-default-arguments check.
courbet updated this object.
courbet added a reviewer: alexfh.
courbet added a subscriber: cfe-commits.
alexfh edited reviewers, added: hokein; removed: alexfh.Apr 27 2016, 4:35 AM
hokein added inline comments.May 2 2016, 1:07 AM
clang-tidy/google/DefaultArgumentsCheck.cpp
32

Usually, clang-tidy's warning message is not a sentence, so remove the . at the end.

How about default arguments on virtual or override methods are prohibited?

clang-tidy/google/GoogleTidyModule.cpp
40

Please keep the alphabetical order.

docs/ReleaseNotes.rst
106

s/vitual/virtual

docs/clang-tidy/checks/google-default-arguments.rst
7

I'm a little confused about the words here. Indeed, the google-default-arguments checks the default parameter given for virtual methods.

test/clang-tidy/google-default-arguments.cpp
6

The the first warning message you need check the all message including the check name.

courbet updated this revision to Diff 56000.May 3 2016, 8:16 AM
courbet marked 4 inline comments as done.

Cosmetics + change error message.

clang-tidy/google/GoogleTidyModule.cpp
40

I think the script auto-generated that, but done.

docs/clang-tidy/checks/google-default-arguments.rst
7

Right, I got mixed up in the terminology: the default argument is given as an initializer for the parameter declaration.

hokein accepted this revision.May 6 2016, 2:25 AM
hokein edited edge metadata.

LGTM with one nit.

test/clang-tidy/google-default-arguments.cpp
10

You can remove the [google-default-arguments] in this line and line 15. Usually we only keep it on the first warning message.

This revision is now accepted and ready to land.May 6 2016, 2:25 AM
courbet updated this revision to Diff 56529.May 8 2016, 11:49 PM
courbet edited edge metadata.
courbet marked an inline comment as done.

Thanks. I don't have write access, could you please submit this for me ?

This revision was automatically updated to reflect the committed changes.