[clang] [analyzer] Model GCC 'cleanup' attribute function calls (PR #221110)

Arseniy Zaostrovnykh via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 9 06:44:47 PDT 2026


================

----------------
necto wrote:

I would add a few more tests exploring the "scope" shape:
- How it interacts with the `goto` inside or outside of the scope covered by the cleanup
- How it interacts with C++ destructors (basically which one runs first, and whether it is deterministic)
- How it handles function inlined by CSA (for a cleanup-annotated declaration in the inlined and in the inlining function). You already have this for nested compound statements, I expect inlined functions to behave the same way, but they are handled by different parts of the expr engine
  - A variation with a cleanup handler installed inside of a lambda body.
- In what order two cleanup handlers are called when they are in the same scope
- Can a cleanup handler be installed on a declaration inside of another cleanup handler?

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


More information about the cfe-commits mailing list