[clang] [Clang] restrict use of attribute names reserved by the C++ standard (PR #106036)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 26 07:39:08 PDT 2024


https://github.com/AaronBallman commented:

I would expect these to be controlled by `-Wreserved-identifier` rather than keyword hiding (these are not keywords), probably in a new group like `-Wreserved-attribute-identifier`, WDYT?

SourceGraph's backend is currently falling over, so I don't have links to share, but I did see examples of `#define likely` in projects like MongoDB and `#define assume` in a fair number of projects. I'm slightly worried about the amount of noise this will generate in practice -- have you tried running these changes over a large corpus of C++ code?

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


More information about the cfe-commits mailing list