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

Doug Wyatt via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 3 11:40:42 PST 2025


dougsonos wrote:

Aha, I dumped a big AST to JSON, searched for a `CXXBindTemporaryExpr` inside a `VarDecl` and came up with this example:

```
/Users/doug/Desktop/makestring.cpp:10:7: warning: function with 'nonblocking' attribute must not call non-'nonblocking' destructor 'String::~String' [-Wfunction-effects]
   10 |         auto str = String::make();
      |              ^
/Users/doug/Desktop/makestring.cpp:10:13: warning: function with 'nonblocking' attribute must not call non-'nonblocking' destructor 'String::~String' [-Wfunction-effects]
   10 |         auto str = String::make();
      |                    ^
```

It may be a little annoying to get two warnings but technically I think there really are two implicit calls to the destructor. (right? the result of `String::make()` might be getting moved-from but there's still an implicit destructor.)

https://github.com/llvm/llvm-project/pull/166110


More information about the cfe-commits mailing list