P4415R0 — Profiles: implementation status and experience
EWGLEWGSG23
Profiles now have two independent implementations. Krystian Stasiowski's Clang implements the P3589R2 framework, except <ins>[[profiles::exempt]]</ins>, and most of the P4222R2 initialization profile <ins>std::init</ins>. Ville Voutilainen's GCC implements the framework, <ins>std::init, and the first working invalidation profile, std::invalidation</ins>, on the design of P3446R0 with the default-deny discipline of P4296R0. Both run in a browser on Compiler Explorer today. This paper reports what each implementation does, where the two agree and where they diverge, what was measured and how, and what the implementation experience says the papers should change. It is a status report, not a design proposal. Every result is dated and most carry a link that reproduces it. The initialization profile works on two compilers and they agree on its core rules. Invalidation works on one, and it rejects all nineteen of a set of adversarial dangling, use-after-free and escaping-address cases. Enforcing <ins>std::init</ins> leaves Clang's generated code byte-identical, which demonstrates the "same meaning" property on a real compiler. The divergences between the two are few, specific, and each on