www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 19070] New: Invalid octal literals `01` through `07` allowed

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

          Issue ID: 19070
           Summary: Invalid octal literals `01` through `07` allowed
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: trivial
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: kubo39 gmail.com

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
}
---

--
Jul 08 2018