JonasToth added a comment.
IMHO this patch is fine, but i think a language expert (not me :D) should take
a look (@aaron.ballman ?) as its complicated :)
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D54745
___
cfe-commits mailing
hokein added a comment.
Thanks for the review.
In https://reviews.llvm.org/D54745#1303972, @JonasToth wrote:
> Does make_unique require the copy constructor if it could move?
No, in that case, move constructor will be used. I have updated the patch to
include these cases.
> And would the
hokein updated this revision to Diff 174760.
hokein marked 2 inline comments as done.
hokein added a comment.
Address review comments, handle move constructor as well.
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D54745
Files:
clang-tidy/modernize/MakeSmartPtrCheck.cpp
JonasToth added a comment.
Does make_unique require the copy constructor if it could move?
And would the same argument apply to the move-constructors as the arguments are
forwarded?
What would happen in the obscure case of a public copy-constructor, but private
move-constructor (not saying it
hokein created this revision.
hokein added reviewers: JonasToth, aaron.ballman.
Herald added a subscriber: xazax.hun.
The fix for aggregate initialization (`std::make_unique(Foo {1, 2})` needs
to see Foo copy constructor, otherwise we will have a compiler error. So we
only emit the check warning.