I wanted to ping this old topic to say that we will be implementing this feature in libc++ on GCC, since they provide the necessary macros to do so (__GCC_DESTRUCTIVE_SIZE and __GCC_CONSTRUCTIVE_SIZE).
Is this feature perfect? No, but it does have a purpose, it was standardized and it was implemented by the other major standard libraries, so we’ll implement it as well. Not doing so just hurts our users by making their code less portable, and it makes us drag behind on our implementation of the Standard.
Also, C++ has many other things that make it much easier to break ABI than having a constexpr value that depends on the target. Concretely, if someone’s using hardware_FOO_interference_size, they probably know about ABI, and they probably understand that this value can change depending on the target (that’s the whole point!). If they use that property in a type that’s ABI facing, it’s unfortunate but it’s kind of their fault.
It would be awesome if someone fluent with Clang could go ahead and implement a builtin or macro for us to use, otherwise we’ll have to ship the feature on GCC only, which isn’t great. Concretely, Clang should probably match what GCC’s doing to keep us ABI-compatible on equivalent targets.
P.S.: If this has been implemented already in Clang and I missed it, please let me know and ignore all of the above! ![]()