[clang] [Clang] Fix build with GCC 14 on ARM (PR #78704)

Sander de Smalen via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 19 04:11:59 PST 2024


================
@@ -760,8 +760,9 @@ KEYWORD(__builtin_available              , KEYALL)
 KEYWORD(__builtin_sycl_unique_stable_name, KEYSYCL)
 
 // Keywords defined by Attr.td.
+// The "EMPTY ## X" is used to prevent early macro-expansion of the keyword.
 #ifndef KEYWORD_ATTRIBUTE
-#define KEYWORD_ATTRIBUTE(X, ...) KEYWORD(X, KEYALL)
+#define KEYWORD_ATTRIBUTE(X, HASARG, EMPTY) KEYWORD(EMPTY ## X, KEYALL)
----------------
sdesmalen-arm wrote:

Would the following suffice?
```
#define EMPTY
#define KEYWORD_ATTRIBUTE(X, HASARG) KEYWORD(EMPTY ## X, KEYALL)
```

Or is the crux of this fix that EMPTY must be an argument to the same macro in order for it not to get expanded?

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


More information about the cfe-commits mailing list