While working with clang-13 in C++20, I noticed that the x86_64-pc-win32-coff cross-compile target seems to outright reject the [[no_unique_address]] attribute. This attribute is otherwise supported for other targets that I tested with.
Consider this minimal example:
struct bar {};
struct foo {
[[no_unique_address]] bar b;
};
which, when compiled with -target=x86_64-pc-win32-coff, produces
<source>:4:7: warning: unknown attribute 'no_unique_address' ignored [-Wunknown-attributes]
[[no_unique_address]] bar b;
^~~~~~~~~~~~~~~~~
1 warning generated.
Is it a known issue for different targets to reject attributes, or is this a product of just the underlying cross-compile target? I know that MSVC historically did not do empty-base optimization and kept this for ABI compatibility; is this a product of that compatibility?
I suspect this is likely a bug in the target since it does not fully satisfy the C++20 spec, but I'm unsure of whether there is a pragmatic or known reason as to why this attribute is outright rejected, when other cross-compile targets seem to work without issue.