Summary: Static arrays with 0 length accepted by compiler
           Product: D
           Version: unspecified
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Keywords: accepts-invalid
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from Andrej Mitrovic <> 2011-05-13 
19:25:14 PDT ---
Is there a use case for 0-length static arrays?

If there's not a use-case, then this should probably be a compiler error:

int[0] logs;  // <- disallow this

void main()
    logs = [4];

The assignment statement causes a linker error (if you comment it out you won't
get any linker errors):
test.obj(test)  Offset 002DFH Record Type 009D
 Error 16: Index Range
--- errorlevel 1

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to