www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12936] New: Some more nogc cases for immediately iterated

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

          Issue ID: 12936
           Summary: Some more  nogc cases for immediately iterated array
                    literal
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: bearophile_hugs eml.cc

This is a spinoff of Issue 12932


See this code:


struct F { int x; }
void main()  nogc {




}



With dmd2.066alpha gives:

test.d(4,25): Error: array literal in  nogc function main may cause GC
allocation
test.d(5,5): Error: argument type mismatch, int[] to ref const(int[1])
test.d(6,25): Error: array literal in  nogc function main may cause GC
allocation



be a dynamic array of int[1] values.





without  nogc.

--
Jun 16 2014