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

Erich Keane via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 17 09:48:15 PST 2025


================
@@ -61,14 +62,23 @@ int clang::hasAttribute(AttributeCommonInfo::Syntax Syntax,
   if (res)
     return res;
 
-  // Check if any plugin provides this attribute.
-  for (auto &Ptr : getAttributePluginInstances())
-    if (Ptr->hasSpelling(Syntax, Name))
-      return 1;
+  if (CheckPlugins) {
+    // Check if any plugin provides this attribute.
+    for (auto &Ptr : getAttributePluginInstances())
+      if (Ptr->hasSpelling(Syntax, Name))
+        return 1;
+  }
 
   return 0;
 }
 
+int clang::hasAttribute(AttributeCommonInfo::Syntax Syntax,
+                        const IdentifierInfo *Scope, const IdentifierInfo *Attr,
+                        const TargetInfo &Target, const LangOptions &LangOpts) {
+  return hasAttribute(Syntax, Scope, Attr, Target, LangOpts,
+                      /*CheckPlugins*/ true);
----------------
erichkeane wrote:

```suggestion
                      /*CheckPlugins=*/ true);
```

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


More information about the llvm-commits mailing list