P4422R0 — Function Summaries for Scaling Code Analysis of C++
EWGSG15SG23
Profiles [P3589R3] are to be enforced by local static analysis [P3274R0]: one translation unit at a time, and within it one function at a time. At a call to a function defined elsewhere, such an analysis has only the callee's declaration. The declaration says little about what the callee writes, and nothing about what it retains, releases or invalidates. The analysis gives the same verdict for every definition that matches the declaration, so it must reject some correct programs or accept some incorrect ones. A function summary resolves this. It states, once per function, what a call requires and what it may do. It is verified against the function's definition where the definition is compiled, and used at every call.