Refresh
It looks like the bug report has been flagged as a duplicate of this , which has an update that says:
The fix for this problem has been checked at compiler sources. The fix should appear in the next major version of Visual C ++.
Original
As Remyabel explained, this is a reported error . Neither gcc nor clang give these results, and the line operator # according to Visual Studios docs, these are the following replacements (emphasis mine forward):
The space preceding the first token of the actual argument and the next last token of the actual argument is ignored. Any empty space between tokens in the actual argument is reduced to one space in the resulting string literal. Thus, if a comment takes place between two tokens in the actual argument, it comes down to one space. The resulting string literal is automatically combined with any adjacent string literals, of which it is separated only by a space.
In addition, if the character contained in the argument usually requires an escape sequence when used in a string literal (for example, the quotation mark character (") or backslash ()), the necessary oblique feedback is automatically inserted before the character.
which corresponds to C ++ draft standard 16.3.2 Operator #, which says:
If the pre-processing token immediately precedes the substitution list, both are replaced by a single character character in the character string preprocessor, which contains a sequence of pre-processing tokens for the corresponding argument. Each occurrence of a space between argument preprocessing tokens becomes a space character in a character string literal. A space is removed before the first preprocessing token and after the last preprocessing token containing the argument. Otherwise, the initial spelling of each preprocessor token in the argument is stored in the literal string of the character string, with the exception of special processing for creating spelling for string literals and character literals: the \ character is inserted before each character of the character of the character character of the character character or string literal (including separator characters).
The only thing that binds R and L relative to C ++ 11 is that they have special meaning with string literals but I donβt see how this should affect this case.
It seems that L\ and R\ also give the same problem.
They document an inappropriate problem , and he says:
Visual C ++ does not behave correctly when the # (stringize) operator is used with strings that include escape sequences. In this situation, the compiler will generate a C2017 compiler error.
which does not cover this case.