[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:49:52 PST 2025
Sirraide wrote:
> 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.
Actually, that doesn’t work too well if someone does weird things like:
```c++
struct S { ~S(); };
S s{S(S())};
```
Obviously no-one writes code like this, but even if you remove *some* of the unnecessary parts here, the AST is still sufficiently complex to where checking all possible patterns becomes annoying.
https://github.com/llvm/llvm-project/pull/166110
More information about the cfe-commits
mailing list