Open Quuxplusone opened 8 years ago
Bugzilla Link | PR27388 |
Status | NEW |
Importance | P normal |
Reported by | kamal essoufi (kessoufi@gmail.com) |
Reported on | 2016-04-16 20:14:30 -0700 |
Last modified on | 2016-04-16 22:13:51 -0700 |
Version | unspecified |
Hardware | PC Linux |
CC | alexfh@google.com, djasper@google.com, kessoufi@gmail.com, klimek@google.com |
Fixed by commit(s) | |
Attachments | |
Blocks | |
Blocked by | |
See also |
I found a workaroud (/fix(?)) :
considering that copy constructor is not a good candidate for modernize-pass-by-
value : the *expected* generated code :
Derived(Derived src) : Base(std::move(src)) {}
triggers clang error : copy constructor must pass its first argument by
reference
In PassByValueCheck.cpp, I replaced :
isCopyConstructor(), unless(isDeleted()),
with this matcher :
AST_MATCHER(CXXConstructorDecl, isNotCopyConstructor) {
return !Node.isCopyConstructor();
}
and only modernize-use-default was applied (correctly) which sounds logical to
me
not sure if this is the right fix though
Regards