This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Simplify modernize-use-default
ClosedPublic

Authored by malcolm.parsons on Oct 19 2016, 6:43 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

malcolm.parsons retitled this revision from to [clang-tidy] Simplify modernize-use-default.
malcolm.parsons updated this object.
malcolm.parsons added a subscriber: cfe-commits.
malcolm.parsons added inline comments.
test/clang-tidy/modernize-use-default-copy.cpp
85 ↗(On Diff #75140)

I don't know why cleanup removes this comment, but there are format units tests that check that it does.

aaron.ballman accepted this revision.Oct 20 2016, 6:35 AM
aaron.ballman edited edge metadata.

LGTM with a small nit, but you may want to wait for @djasper to weigh in on the removed comment question.

clang-tidy/modernize/UseDefaultCheck.cpp
266 ↗(On Diff #75140)

You can use const auto * here.

This revision is now accepted and ready to land.Oct 20 2016, 6:35 AM
djasper accepted this revision.Oct 20 2016, 6:43 AM
djasper added a reviewer: ioeric.
djasper added a reviewer: djasper.

I don't know whether it is an intentional choice to remove this comment. I'd be fine either way (I think there are arguments for and against it). So, this looks good to me. But maybe Eric has something to add.

ioeric accepted this revision.Oct 20 2016, 6:54 AM
ioeric edited edge metadata.
ioeric added inline comments.
test/clang-tidy/modernize-use-default-copy.cpp
85 ↗(On Diff #75140)

This is intended behavior of cleanup. Generally, if a deleted code results in a redundant token around it, comments between the redundant token and its previous/next token (ignoring the deleted code) are considered belonging to the deleted code. Considering how a normal developer writes code, this would be correct most of the time IMO.

This revision was automatically updated to reflect the committed changes.