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
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to