This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Add a checker that flags all instances of overloaded unary operator&
ClosedPublic

Authored by bkramer on Jul 14 2014, 9:27 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

bkramer updated this revision to Diff 11387.Jul 14 2014, 9:27 AM
bkramer retitled this revision from to [clang-tidy] Add a checker that flags all instances of overloaded unary operator&.
bkramer updated this object.
bkramer added reviewers: alexfh, djasper.
bkramer added a subscriber: Unknown Object (MLST).
alexfh added inline comments.Jul 15 2014, 2:42 AM
clang-tidy/google/OverloadedUnaryAndCheck.cpp
30 ↗(On Diff #11387)

Why is the outer matcher just "decl" and not "functionDecl"?

38 ↗(On Diff #11387)

The original cpplint.py message is not very clear. I think, it should say "do not overload it".

test/clang-tidy/google-overloaded-unary-and.cpp
1 ↗(On Diff #11387)

With -implicit-check-not it becomes bulky. We should make both CHECK-MESSAGES and CHECK-FIXES optional in check_clang_tidy_fix.sh and give the script a more generic name.

There's no need to do it in this patch, though.

4 ↗(On Diff #11387)

How about tests with template instantiations? ;)

bkramer updated this revision to Diff 11428.Jul 15 2014, 3:15 AM
  • Reworded message
  • Added test with template instance. Not as valuable here as with the other checkers as we don't have fixits.
alexfh accepted this revision.Jul 15 2014, 5:45 AM
alexfh edited edge metadata.

Looks good!

This revision is now accepted and ready to land.Jul 15 2014, 5:45 AM
bkramer closed this revision.Jul 15 2014, 5:57 AM
bkramer updated this revision to Diff 11435.

Closed by commit rL213067 (authored by d0k).