Page MenuHomePhabricator

[clang-tidy] Fix misc-move-const-arg for move-only types.
ClosedPublic

Authored by alexfh on Mar 20 2017, 4:33 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

alexfh created this revision.Mar 20 2017, 4:33 PM
alexfh updated this revision to Diff 97971.May 5 2017, 9:28 AM

Rebased on HEAD.

alexfh added a comment.May 5 2017, 9:29 AM

Friendly ping.

sbenza added inline comments.May 5 2017, 9:41 AM
clang-tidy/misc/MoveConstantArgumentCheck.cpp
76 ↗(On Diff #97971)

Can we get this from R->hasTrivialCopyConstructor or R->hasNonTrivialCopyConstructor instead of iterating all constructors?

alexfh added inline comments.May 5 2017, 9:58 AM
clang-tidy/misc/MoveConstantArgumentCheck.cpp
76 ↗(On Diff #97971)

Interesting idea, trying R->hasTrivialCopyConstructor() || R->hasNonTrivialCopyConstructor().

alexfh added inline comments.May 5 2017, 10:15 AM
clang-tidy/misc/MoveConstantArgumentCheck.cpp
76 ↗(On Diff #97971)

I meant the opposite: !R->hasTrivialCopyConstructor() && !R->hasNonTrivialCopyConstructor(). But anyway it doesn't work. We could store another bit for deleted copy constructor, but it wouldn't worth it, if it's needed in this single case.

alexfh marked 3 inline comments as done.May 5 2017, 10:15 AM
sbenza accepted this revision.May 5 2017, 10:25 AM
This revision is now accepted and ready to land.May 5 2017, 10:25 AM
This revision was automatically updated to reflect the committed changes.