Full name of submitter (unless configured in github; will be published with the issue): Jay Ghiron
Reference (section label): [lex.phases]/1.3
Issue description:
Consider the following two macro definitions:
#define X π
#define X \u03C0
According to translation phase three, these macro definitions should be equivalent because the universal-character-name should be replaced by the character it represents (U+03C0). However, GCC and MSVC reject this and consider them to be different. Clang accepts them as the same, but does not actually treat them the same:
#include<iostream>
#define S(...)#__VA_OPT__(__VA_ARGS__)
int main(){
#define X π
std::cout<<S(S(X)\n);//"π"
//if #undef is added here, all three compilers agree on these outputs
#define X \u03C0
std::cout<<S(S(X)\n);//"\u03C0"
}
Additionally, the current wording forbids the following:
#define Y \##u03C0
int Y;
Since there is no preprocessing token of the form \u03C0 this is invalid, even though the intent is to allow it.
Related: P2314 and P2621
Full name of submitter (unless configured in github; will be published with the issue): Jay Ghiron
Reference (section label): [lex.phases]/1.3
Issue description:
Consider the following two macro definitions:
According to translation phase three, these macro definitions should be equivalent because the universal-character-name should be replaced by the character it represents (U+03C0). However, GCC and MSVC reject this and consider them to be different. Clang accepts them as the same, but does not actually treat them the same:
Additionally, the current wording forbids the following:
Since there is no preprocessing token of the form
\u03C0this is invalid, even though the intent is to allow it.Related: P2314 and P2621