https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109877
--- Comment #21 from Joseph S. Myers <jsm28 at gcc dot gnu.org> --- In C, see 6.4.1 "If the input stream has been parsed into preprocessing tokens up to a given character, the next preprocessing token is the longest sequence of characters that could constitute a preprocessing token.". This is phase 3; preprocessing tokens don't get converted to tokens until phase 7. 10.1.2 is a perfectly valid preprocessing token; it's fine to stringize it, for example, or include it in an argument to a macro that that macro discards; it's only if it survives until phase 7 that anything is invalid. I'd guess you might define CPP_NUMBER_INVALID or similar for when such preprocessing tokens are converted to tokens, and somehow defer the diagnostics for exactly how it's not a valid token until a later stage of parsing.
