[clang] [Clang] FunctionEffect analysis was missing a CXXBindTemporaryExpr's implicit call to a destructor. (PR #166110)

via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 3 11:46:46 PST 2025


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


More information about the cfe-commits mailing list