[clang] [C2y] Support WG14 N3457, the __COUNTER__ macro (PR #162662)
Hubert Tong via cfe-commits
cfe-commits at lists.llvm.org
Wed Oct 15 12:49:16 PDT 2025
hubert-reinterpretcast wrote:
> Clang and GCC get the same behavior, EDG has `1 2 3 0`, and MSVC comes up with `1 2 __VA_OPT__(3) 0` so there's implementation divergence; changing the behavior to deviate from GCC seems like something we may want to consider outside of the scope of this particular PR. How about I add test coverage for this with a FIXME comment and mark our support as partial? Then I can file an issue to track the behavior and we can get around to fixing that when we do.
Sounds good. For info, the "new" MSVC preprocessor gives `0 23 1` (https://godbolt.org/z/Go6P4xq4a).
With respect to the relative positioning for `2` and `3`, we have a situation where all implementations behave one way and the wording implies another.
https://github.com/llvm/llvm-project/pull/162662
More information about the cfe-commits
mailing list