https://github.com/HerrCai0907 requested changes to this pull request.
This check has some issue in my opinion, the semantic of `std::move(*p)` are not same as `*std::move(p)` ```c++ #include <iostream> #include <memory> #include <string> using std::unique_ptr; void f1() { unique_ptr<std::string> p{new std::string("demo")}; std::cout << p.get() << " *p=" << *p << "\n"; auto x = std::move(*p); std::cout << p.get() << " *p=" << *p << " x=" << x << "\n"; } void f2() { unique_ptr<std::string> p{new std::string("demo")}; std::cout << p.get() << " *p=" << *p << "\n"; auto x = *std::move(p); std::cout << p.get() << " *p=" << *p << " x=" << x << "\n"; } int main() { std::cout << "std::move(*p)\n"; f1(); std::cout << "*std::move(p)\n"; f2(); } ``` The output is ``` std::move(*p) 0x603000001b40 *p=demo 0x603000001b40 *p= x=demo *std::move(p) 0x603000001b70 *p=demo 0x603000001b70 *p=demo x=demo ``` In `*std::move(p)`, move constructor does not happen, it is same as *p. https://github.com/llvm/llvm-project/pull/66139 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits