Hello. I'm found a bug with tokens concatenation. Simple example to reproduce:
#define test(x, y) sizeof(x##y)
#define test2(x, y) sizeof(##x##y)
int main()
{
int a = test(in, t); // works fine
int b = test2(in, t); // error
}Compilation on windows (msvc integration):
1> main.cpp 1>..\main.cpp(6): error : identifier "in" is undefined 1> int b = test2(in, t); // error 1> ^ 1> 1>..\main.cpp(6): error : expected a ")" 1> int b = test2(in, t); // error
Preprocessor output to file:
#line 1 "..\\main.cpp"
int main()
{
int a = sizeof(int);
int b = sizeof(int);
}
Thread Topic:
Bug Report