https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109936

--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Adam Wozniak from comment #4)
> reopening.  this is not at all "expected".
> 
> C++ papers P1041R4 and P1139R2 cover literal constants in code.
> they do not at all cover anything about arguments to C preprocessor macros.
> 
> in this case, the macro generates no code.

That isn't the point. The compiler has to tokenize the input in order to
perform the preprocessing step. That means it has to be able to decide what the
bytes comprising the ≠ mean. Are they multiple tokens? A single token
consisting of an identifier? A C++ operator?

The standard says "Each preprocessing token that is converted to a token (5.6)
shall have the lexical form of a keyword, an identifier, a literal, or an
operator or punctuator."

≠ cannot be used in an identifier, and it's none of the other forms either.

> it should be perfectly legal to use these as arguments.

By that argument, you could say X(£), but that isn't allowed either.

> note the emoji passes through flawlessly.

Not with -Wpedantic

Reply via email to