This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Add a whitelist option in google-runtime-references.
ClosedPublic

Authored by hokein on Oct 4 2016, 10:08 AM.

Event Timeline

hokein updated this revision to Diff 73503.Oct 4 2016, 10:08 AM
hokein retitled this revision from to [clang-tidy] Add a whitelist option in google-runtime-references..
hokein updated this object.
hokein added a reviewer: aaron.ballman.
hokein added a subscriber: cfe-commits.
hokein added a comment.Oct 7 2016, 7:06 AM

friendly ping. Aaron, could you take a look on this patch?

aaron.ballman accepted this revision.Oct 7 2016, 11:23 AM
aaron.ballman edited edge metadata.

LGTM with a small nit.

clang-tidy/google/NonConstReferences.cpp
71–75

I think this would be a bit easier to read with std::find_if rather than a manual loop. If you decide to stick with the manual loop, the colon in the range-based for loop needs a preceding space.

This revision is now accepted and ready to land.Oct 7 2016, 11:23 AM
hokein updated this revision to Diff 74138.Oct 10 2016, 9:37 AM
hokein marked an inline comment as done.
hokein edited edge metadata.

Address review comments.

Eugene.Zelenko added a subscriber: Eugene.Zelenko.

Committed in rL283777.

alexfh added a subscriber: alexfh.Oct 11 2016, 9:50 AM
alexfh added inline comments.
clang-tidy/google/NonConstReferences.cpp
73

It should be possible to check the whitelist in the matcher (qualType(unless(anyOf(isConstQualified(), hasDeclaration(namedDecl(hasAnyName(WhiteListTypes)))))) or something similar).