Wow that title is a mouthful. Here's a concrete example:
extern const __declspec(selectany) struct { int x; } foo = { 42 };
clang-cl gives the error:
> clang-cl main.cpp
main.cpp(2,25): error: 'selectany' can only be applied to data items with external linkage
2 | extern const __declspec(selectany) struct { int x; } foo = { 42 };
| ^
1 error generated.
> clang -v
clang version 19.1.0
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\Program Files\LLVM\bin
Of course, if you give the struct its own definition, the code compiles fine:
struct bar { int x; };
extern const __declspec(selectany) bar foo = { 42 };
MSVC compiles both without issue.