<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/60057>60057</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Recommend `std::move` when attempting a copy for a move-only type with public move constructors
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
varungandhi-src
</td>
</tr>
</table>
<pre>
E.g. with a code pattern like:
```cpp
struct F {
F() = default;
F(const F &) = delete;
// ^ note: 'F' has been explicitly marked deleted here
F(F &&) = default;
};
struct G {
F f;
G(F &&f): f(f) {}
// ^ error: call to deleted constructor of 'F'
};
```
Technically, the error message is correct. I think it could be made more helpful by suggesting that wrapping the operation in `std::move` is the right fix.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx0U91yqywUfRq82ROHYKLmwov2S-18t2fOCyBshVMEBrCpb38G0zZpp8dx_Nl_ay1g8Rj1ZBE7cnwkx3PBl6Rc6F55WOzErVR6F4MoBifX7qmcSrjopICDcBLB85QwWDD6BUn1QOiZ0I9nTa-38P4aiSksIkEPpHm8RgAAesJawk5AqjNIHPliEqm-5YWzcWtk9a3UYMJbJWE9YT2Q4xNYlxM51PSENaB4hAHRAr55o4VOZoWZhxeU71MkKAz4FfIdrP4XNdKcb9_38p6_yYPxi5znu9kjYadMdCSsHTeg5jHP_Sz-vO7UYQgu5C7BjYHkPjVsi5QpuABu_FD_A9uPjbkn_xuFsjqPXAn7D5LCKxDMGCOfEHQE4UJAkUr4H5LS9gV0AuEWI2FAmLlEmF1AUGj8uBgYVojLNGFM2k6QFE9wCdz76x-C8xh40s6CtkBqGpPMR6h6mN0rkppmyFwX9KQSjPqtLGRXyVN14gV2-7qp2qret22hOkTasL3E6oCylXtG5chEw-ixQiEk0kJ3jLKK7vc1Zex0aMu6PnB5OoxyPxzH9kjJgeLMtSmNeZ1LF6ZCx7hgV1N6bArDBzRxcwhjFi-wJQlj2TChyz27YZkiOVCjY4q3KUkng90vFG6e0cofdV4UWshGmv22VNlbfoXRBeCQi3bOmhXS6vFqPr8MRostdb_rsViC6VRKPmaA7chMOqllKIWbCeszq_fXzgf3B0UirN-0RML6TevfAAAA__8qPjbc">