[clang] [WebKit checkers] Treat a move constructor as non-trivial (PR #184986)
Ryosuke Niwa via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 6 02:54:26 PST 2026
rniwa 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:
```
std::unique_ptr<Foo> x = make_unique<Foo>();
std::unique_ptr<Foo> y = std::move(x);
```
https://github.com/llvm/llvm-project/pull/184986
More information about the cfe-commits
mailing list