[clang] [Clang] Add __ugly__ spelling for the msvc attribute scope (PR #113765)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 30 05:51:34 PDT 2024


AaronBallman wrote:

> > > The MSVC FE team hasn't expressed enthusiasm for adding ugly spellings. If I learn more I'll relay that info.
> > 
> > 
> > Thank you for checking! Unfortunately, I think that's a reason for Clang to not support it for the `msvc` vendor prefix either.
> 
> What is the alternative?

Can you get away with not using `[[msvc::no_unique_address]]`? If so, I'd go that route. If not, I'd say use the attribute with the non-ugly spelling and woe unto anyone defining `msvc` as a macro despite that being a perfectly valid thing for them to do. You could be "kind" and do
```
#ifdef msvc
#error "Microsoft's vendor specific attribute prefix steals this identifier from the user's namespace, please file an issue with Microsoft if you see this diagnostic"
#endif
```
or something along those lines.

https://github.com/llvm/llvm-project/pull/113765


More information about the cfe-commits mailing list