This is a very strange problem. It's a very simple looking function-like macro, and I have seen its examples many times. I have even used it before! However, I just couldn't get this working after 6 hours. I got exhausted, and decided to ask here. Maybe somebody spots the problem. The minimal reproducible case is:
enum e {
x, y, z,
#define Func(X, Y, Z) \
my_##X = Y
Func(x, y, z),
};
It's used in clang source code in a similar way. I, too, include a file that's containing both the definition and use of the macro.
EDIT:
Thanks a lot for answers and comments. It's true that I have used Godbolt, but after my build failed. It turned out that macro has never failed during my build. That's because I haven't used the macro! It's not used, so it never generated an output. That's quite shameful. I have to accept my mistake, and move on. I must have checked it by preprocessing locally. Getting empty string in Godbolt made me believe that I am doing something wrong.