C++ Logo

sg16

Advanced search

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

From: Hubert Tong <hubert.reinterpretcast_at_[hidden]>
Date: Thu, 9 Jul 2026 14:47:57 -0400
On Thu, Jul 9, 2026 at 12:15 PM Corentin via SG16 <sg16_at_[hidden]>
wrote:

> 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
>

Please make statements that conform to the version of the wording that you
point to.
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2025/p3658r1.pdf is not
incorporated.


>
> I struggle to understand the logic here.
>

User-defined literals exist, no?


> 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
> --
> SG16 mailing list
> SG16_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/sg16
> Link to this post: http://lists.isocpp.org/sg16/2026/07/4828.php
>

Received on 2026-07-09 18:48:32