www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12034] New: Union and inlining leads to erroneous "Error: variable used before set"

reply d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=12034

           Summary: Union and inlining leads to erroneous "Error: variable
                    used before set"
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: aliloko gmail.com


--- Comment #0 from ponce <aliloko gmail.com> 2014-01-29 10:59:06 PST ---
How to reproduce:

---
import std.numeric;

alias CustomFloat!16 half_t;

union half_ushort
{
    half_t f;
    ushort i;
}

void fun()
{
    half_t asHalf = 0;
    half_ushort hu = void;
    hu.f = asHalf;         
}
---

Present in both DMD 2.065b2 and DMD 2.064.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 29 2014
parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=12034



--- Comment #1 from ponce <aliloko gmail.com> 2014-01-29 10:59:59 PST ---
Compile with:
$ dmd testcase.d -O -inline

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 29 2014