Skip to main content

Module raii

Module raii 

Source
Expand description

Provable temporary-free classification of C++ call expressions.

The C++ lowering marks a callable as having RAII boundaries when its body contains any call expression, because a call can materialize a class-typed temporary whose destructor runs at the end of the full expression. That over-approximation is honest for unknown callees, but it is refutable for an exact local free-function call whose signature proves that neither the returned value nor any parameter conversion can materialize an automatic object that needs destruction (#1984, under #1951).

CppTemporaryFreeCallIndex holds the per-file proof. It stays strictly conservative: any preprocessor content, any second declaration of the name, any non-callee use of the name (function pointers, address-taking, shadowing locals, member declarations), templates, overloads, virtual or member call syntax, default arguments, variadic parameters, and non-trivial argument expressions all keep the call unproven, so the RAII gap stays.

Structsยง

CppTemporaryFreeCallIndex
The per-file index answering whether a call expression provably materializes no automatic object that needs destruction.