================
@@ -41,6 +41,12 @@ struct AccessPath {
const clang::MaterializeTemporaryExpr *>
P;
+ // An expression which is responsible for moving the storage. Loans with such
+ // a storage as considered to be potentially moved and could remain valid
even
+ // after the expiry of the access path. Use of such expired loans are
reported
+ // differently as a strict non-default warning.
+ const Expr *MovedExpr = nullptr;
----------------
Xazax-hun wrote:
I don't think `MovedExpr` belongs to the `AccessPath`.
Consider:
```
if (cond) {
f(std::move(x));
} else {
g(std::move(x));
}
```
or even the obviously wrong:
```
f(std::move(x));
g(std::move(x));
```
Whether an access path was moved and what expression moved it is flow sensitive
information. The access path itself is not. So I think these should be
separate.
https://github.com/llvm/llvm-project/pull/178670
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits