Bug 19070 – Octal literals `01` through `07` allowed, but not in the grammar

Status
REOPENED
Severity
trivial
Priority
P4
Component
dlang.org
Product
D
Version
D2
Platform
All
OS
All
Creation time
2018-07-08T13:06:25Z
Last change time
2024-12-15T15:25:09Z
Keywords
pull, spec
Assigned to
No Owner
Creator
Hiroki Noda
Moved to GitHub: dlang.org#4091 →

Comments

Comment #0 by kubo39 — 2018-07-08T13:06:25Z
I found these pathlogical examples pass the lexer: --- void main() { assert(01 == 1); // can compile and run. assert(010 == 8); // Error: octal literals 010 are no longer supported, use std.conv.octal!10 instead } ---
Comment #1 by kubo39 — 2018-07-12T15:41:27Z
Comment #2 by schveiguy — 2018-09-14T13:54:47Z
This is a spec issue, literals 01 through 07 are correct decimal literals, so the confusion caused by using octals is not relevant there.
Comment #3 by kubo39 — 2019-07-25T02:33:40Z
Comment #4 by dkorpel — 2021-07-15T19:06:48Z
As long as neither the spec nor dmd are updated to accommodate the other, this remains an open issue.
Comment #5 by dlang-bot — 2021-07-15T19:40:57Z
@schveiguy created dlang/dlang.org pull request #3066 "Fix issue 19070 - some octal literals are actually allowed" fixing this issue: - Fix issue 19070 - some octal literals are actually allowed https://github.com/dlang/dlang.org/pull/3066
Comment #6 by robert.schadek — 2024-12-15T15:25:09Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dlang.org/issues/4091 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB