[clang] [clang][Lex] Diagnose keywords in macro expansions (PR #242626)

Chen Miao via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 1 01:48:45 PST 2026


================
@@ -0,0 +1,22 @@
+// RUN: %clang_cc1 -std=c++98 -fsyntax-only -verify -Wc++11-compat %s
+
+#define ID(x) x
+#define DISCARD(x)
+#define EXPAND_AND_DISCARD(x) DISCARD(x)
+
+#define constexpr const
----------------
ChenMiaoi wrote:

That works for me, then. I’ll make the change. One small thing I wanted to point out: the original FIXME used #define constexpr constexpr.

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


More information about the cfe-commits mailing list