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

Nikita Popov via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 19 04:43:41 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)
----------------
nikic wrote:

Macros don't get expanded in `##` so this will produce something like `EMPTY__arm_streaming`. I believe the only way to actually get an empty concatenation is via an empty macro argument.

Here's a godbolt to experiment: https://cpp.godbolt.org/z/d9zc7hs3a

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


More information about the cfe-commits mailing list