C++ Logo

sg16

Advanced search

[isocpp-sg16] pp-number does not make sense to me

From: Corentin <corentin.jabot_at_[hidden]>
Date: Thu, 9 Jul 2026 18:15:13 +0200
I was trying to please people who aim to enrich their code by spreading
dollar signs.

I started to look at the definition of pp-number and found an adjacent
issue.
https://eel.is/c++draft/lex.ppnumber#nt:pp-number.

By that grammar

#define A 10∞ // pp-number
#define B 1'0∞ // pp-number
#define C 1'∞0 // not a pp-number

I struggle to understand the logic here.
The good thing is that we are consistent with C.

But... I think we should restrict the grammar to digit/non-digit.
Not only it would simplify implementations, be more self-consistent and
avoid issues with non-basic-latin unicode digits,
including confusables.

(From there, I'd argue we don't want to add dollar to non-digits - there is
no reason to muck about with the definition of pp-number when we extend the
set of valid identifiers)

Thanks

Received on 2026-07-09 16:15:37