Skip to content

[lex.icon] p1 does not clearly cover the (single-digit) integer literal '0' #8380

@morinmorin

Description

@morinmorin

PR #3650 slimmed down [lex.icon] p1 to

In an \grammarterm{integer-literal}, the sequence of \grammarterm{binary-digit}s, \grammarterm{octal-digit}s, \grammarterm{digit}s, or \grammarterm{hexadecimal-digit}s is interpreted as a base $N$ integer

However, the zero in the octal integer literal '0' is not a (grammar term) octal-digits. So '0' falls outside of this wording.

For reference:

\begin{bnf}
\nontermdef{octal-literal}\br
    \terminal{0}\br
    octal-literal \opt{\terminal{'}} octal-digit
\end{bnf}
\begin{bnf}
\nontermdef{octal-digit} \textnormal{one of}\br
    \terminal{0  1  2  3  4  5  6  7}
\end{bnf}

Metadata

Metadata

Assignees

No one assigned

    Labels

    cwgIssue must be reviewed by CWG.not-editorialIssue is not deemed editorial; the editorial issue is kept open for tracking.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions