steakhal wrote:

> > I don't understand this. For example, moving a `std::unique_ptr` does not 
> > call `operator delete`. Nor does the destruction of the destructor of such 
> > a moved-from object.
> 
> That is true. But once you've moved `std::unique_ptr`, you're not supposed to 
> use/touch that object, or else you're doing use-after-move. For example, 
> you're not supposed to access `x` after:
> 
> ```c++
> std::unique_ptr<Foo> x = make_unique<Foo>();
> std::unique_ptr<Foo> y = std::move(x);
> ```

Okay, so basically you are suggesting to consider it "dead". While in contrast, 
some objects (e.g. most STL types, containers, etc) have well-defined 
moved-from semantics. They usually behave as if it was default constructed.

In this sense, for the sake of the analysis I could be convinced.

https://github.com/llvm/llvm-project/pull/184986
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to