Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Octal literals 01 through 07 allowed, but not in the grammar #4091

Open
dlangBugzillaToGithub opened this issue Jul 8, 2018 · 5 comments
Open

Comments

@dlangBugzillaToGithub
Copy link

Hiroki Noda (@kubo39) reported this on 2018-07-08T13:06:25Z

Transferred from https://issues.dlang.org/show_bug.cgi?id=19070

CC List

Description

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
}
---
@dlangBugzillaToGithub
Copy link
Author

kubo39 commented on 2018-07-12T15:41:27Z

Attemptive PR : https://github.com/dlang/dmd/pull/8490

@dlangBugzillaToGithub
Copy link
Author

schveiguy (@schveiguy) commented on 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.

@dlangBugzillaToGithub
Copy link
Author

kubo39 commented on 2019-07-25T02:33:40Z

Close this: see https://github.com/dlang/dmd/pull/8490#issuecomment-404716464

@dlangBugzillaToGithub
Copy link
Author

dkorpel commented on 2021-07-15T19:06:48Z

As long as neither the spec nor dmd are updated to accommodate the other, this remains an open issue.

@dlangBugzillaToGithub
Copy link
Author

dlang-bot commented on 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant