https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98893
--- Comment #1 from Nathan Sidwell <nathan at gcc dot gnu.org> --- I think the right direction is to use lambdas. That would make the cleanup function have a scope attached or related to the variable being dtord. Howevr, we cannot use actual lambdas, as that'd disturb the ABI-specified mangling of function-scope lambdas. We'd need some kind of separate numbering or naming (perhaps from the variable in question?)