Sirraide wrote:

> > the result of `String::make()` might be getting moved-from
> 
> Only if it returns an xvalue; if it returns a prvalue, it’s directly 
> constructed into `str`, so we only get a single destructor call.

In this case, the initialiser contains a `CXXBindTemporaryExpr` if it’s a 
prvalue; I wonder if it would suffice to check if the initialiser of the 
`VarDecl` is an `ExprWithCleanups` that wraps a `CXXBindTemporaryExpr` and not 
visit the type of the `VarDecl` in that case.

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

Reply via email to