[clang] [clang] Don't warn on __COUNTER__ in system macros (PR #196689)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Mon May 11 05:49:26 PDT 2026


================
@@ -0,0 +1,7 @@
+#define COUNTER_ALIAS __COUNTER__
+#define COUNTER_MACRO() __COUNTER__
+
+int header_counter_value = __COUNTER__;
+int header_counter_alias = COUNTER_ALIAS;
+int header_counter_macro = COUNTER_MACRO();
----------------
AaronBallman wrote:

Can you also add a test case like what's happening in https://github.com/llvm/llvm-project/issues/196474 ? I believe that issue should also be resolved by these changes.

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


More information about the cfe-commits mailing list