[Bug c++/114357] New: C++: Support the no_destroy attribute
i at maskray dot me
gcc-bugzilla@gcc.gnu.org
Fri Mar 15 21:48:02 GMT 2024
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114357
Bug ID: 114357
Summary: C++: Support the no_destroy attribute
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: i at maskray dot me
Target Milestone: ---
Clang supports [[clang::no_destroy]] (alternative form:
`__attribute__((no_destroy))`) to disable exit-time destructors of variables of
static or thread local storage duration.
* July 2018 discussion:
https://discourse.llvm.org/t/rfc-suppress-c-static-destructor-registration/49128
* Patch: https://reviews.llvm.org/D50994 with follow-up
https://reviews.llvm.org/D54344
* Current documentation:
https://clang.llvm.org/docs/AttributeReference.html#no-destroy
* https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1247r0.html (seems
not presented to EWG yet)
[[clang::always_destroy]] enables exit-time destructors for specific objects
(when -fno-c++-static-destructors disables exit-time destructors globally).
More information about the Gcc-bugs
mailing list