D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 19070 - Octal literals `01` through `07` allowed, but not in the grammar
Summary: Octal literals `01` through `07` allowed, but not in the grammar
Status: REOPENED
Alias: None
Product: D
Classification: Unclassified
Component: dlang.org (show other issues)
Version: D2
Hardware: All All
: P4 trivial
Assignee: No Owner
URL:
Keywords: pull, spec
Depends on:
Blocks:
 
Reported: 2018-07-08 13:06 UTC by Hiroki Noda
Modified: 2024-12-15 15:25 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Hiroki Noda 2018-07-08 13:06:25 UTC
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 Hiroki Noda 2018-07-12 15:41:27 UTC
Attemptive PR : https://github.com/dlang/dmd/pull/8490
Comment 2 Steven Schveighoffer 2018-09-14 13:54:47 UTC
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 Hiroki Noda 2019-07-25 02:33:40 UTC
Close this: see https://github.com/dlang/dmd/pull/8490#issuecomment-404716464
Comment 4 Dennis 2021-07-15 19:06:48 UTC
As long as neither the spec nor dmd are updated to accommodate the other, this remains an open issue.
Comment 5 Dlang Bot 2021-07-15 19:40:57 UTC
@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 dlangBugzillaToGithub 2024-12-15 15:25:09 UTC
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