[Issue 19320] -cov and -O yield variable used before set

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue May 14 23:31:02 UTC 2019


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

Seb <greeenify at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |greeenify at gmail.com
            Summary|Unittest error: Variable    |-cov and -O yield variable
                   |used before set in          |used before set
                   |std/array.d                 |

--- Comment #2 from Seb <greeenify at gmail.com> ---
Reduced with

$ dustmite --no-redirect . "~/dlang/bin/dmddev -O -cov -unittest -main array.d
2>&1 | grep 'variable theArray used before set'"


Resulting in:

$ dmd -O -cov array.d

```
auto staticArray(U, T)(T)
{
    U[] theArray = void;
    return theArray;
}


void main()
{
    staticArray!(int, int)(3);
}
```

Making it clear that this bug is a result of -O and -cov.

--


More information about the Digitalmars-d-bugs mailing list