This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 115g. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2024-12-16


1947. Digit separators following non-octal prefix

Section: 5.13.2  [lex.icon]     Status: NAD     Submitter: Japan     Date: 2014-08-12

(From item JP 03 of the Japanese National Body comments on the C++14 DIS ballot.)

A digit separator is allowed immediately following the prefix for an octal literal but not for a binary or hexadecimal literal. For example, 0'01 is permitted but 0b'01 and 0x'01 are not. This asymmetry makes tools such as automatic code generators more complicated than necessary. The digit separator should be consistently allowed or disallowed immediately following the prefix in all non-decimal integer literals.

Rationale (November, 2014):

CWG felt that the reported asymmetry is not a major difficulty and that it is more natural to think of the leading 0 in an octal literal as part of the numeric value rather than as a separate prefix, as it is with 0b and 0x. Consequently there was no consensus for a change to the existing specification.