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

via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 26 14:02:11 PDT 2024


================
@@ -177,6 +177,26 @@ static bool isLanguageDefinedBuiltin(const SourceManager &SourceMgr,
   return false;
 }
 
+static bool isReservedAttrName(Preprocessor &PP, IdentifierInfo *II) {
----------------
Sirraide wrote:

> The [Attr.td](https://github.com/llvm/llvm-project/blob/main/clang/include/clang/Basic/Attr.td) file contain some details about attributes. I'm uncertain whether this file is sufficient for our case or if we need to define a new one...

>From what I can tell, you’ll have to extend ClangAttrEmitter and introduce a new flag in `Attr.td` that is set for every standard C++ attribute (e.g. `CXX11NoReturn`, but not `C11NoReturn` or `NoReturn`).

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


More information about the cfe-commits mailing list