Sure it does.
Here we go:
#define Yad(x) Y ## x
Yad(()
Result - error.
Here we go again:
#define Yad(x) (
#define REDO(x) x
#define AREDO(x) #x A ## x
#define A(x) A ## REDO(x)
A(Yad(x))
Result - "(" A(
Is it conformable with C++ Standart (This trick doesnt work in gcc)
Why it works so

UB in macros? (MS VC compiler does unbelievable tricks)
noahmattern
news:d69843ac-76b7-4797-82c1-2c0fd203c173@discussions.microsoft.com
> Sure it does.
> Here we go:
> #define Yad(x) Y ## x
> Yad(()
> Result - error.
> Here we go again:
> #define Yad(x) (
> #define AREDO(x) #x A ## x
> #define A(x) A ## REDO(x)
> A(Yad)
> Result - "(" A(
> Is it conformable with C++ Standart (This trick doesnt work in gcc)
--
With best wishes,
Igor Tandetnik
BPeck
Thanks in advance for taking the time to report the issue!
Thanks,
Ayman Shoukry
VC++ Team
Bruno Denuit - MSFT
But this bug can be usefull, should MS programmers fix it :D
SujathaJaganathan
BEGGING MY PARDONS, there were a little error in the source code, so it's work wasnt correctly (bug wasnt seen). But now I fix it, so the bug is now seen.
Submitted to lab.