PiotrZSL added a comment.

You right swap case can also be invalid (rvalue not needed, there).
Anyway it it has too be script then this can be strict.

But message could be better, for example if we don't move all fields of class, 
then this could warn that its not fully moved, or that some members are 
accessed without move., or at least is not moved as whole.
Because not it could be confusing...

  void Class:set(Obj&& obj) // warning: rvalue reference parameter 'obj' is 
never moved from inside the function body 
[cppcoreguidelines-rvalue-reference-param-not-moved]
  {
      this->a = std::move(obj.a);
      this->b = std::move(obj.b);
      this->c = std::move(obj.c);
  }

And then when you read "is never moved" you tap your forehead, about whats 
going on, you did move everything you wanted.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D141569/new/

https://reviews.llvm.org/D141569

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to