On 8 Feb 2023, at 07:33, Timur Doumler <cpp@timur.audio> wrote:
Attributes themselves (the bits within the [[]]) are not portable,
even for the standard attributes.

Exactly, So if you, as the user, rely on whether or not the semantics of the attribute kick in, and whether or not they will break your ABI, you have already lost, regardless of how __has_cpp_attribute is specified.

To emphasise what I am saying here:

If you want a [[no_unique_address]] where you can rely on the attribute changing (or not changing) the ABI of a class, and branch on that, then it should not be an attribute. It should be a keyword instead. Just like `alignas`. This is not what attributes are for IMHO.

Cheers,
Timur