www.digitalmars.com         C & C++   DMDScript  

D.gnu - [Bug 183] New: ICE: in complete_ctor_at_level_p, at expr.c:5775

Date: Tue, 28 Apr 2015 08:48:30 +0100
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"

http://bugzilla.gdcproject.org/show_bug.cgi?id=183

            Bug ID: 183
           Summary: ICE: in complete_ctor_at_level_p, at expr.c:5775 (ctor
                    of struct containing union fails)
           Product: GDC
           Version: 4.9.x
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: Normal
         Component: gdc
          Assignee: ibuclaw gdcproject.org
          Reporter: drug2004 bk.ru

If struct contains union of structs its ctor fails.
union Coord
{
    struct
    {
        double x, y, z;
    }
    struct
    {
        double lon, lat, alt;
    }
}

struct Foo
{
    Coord coord;

    this(double x, double y, double z)
    {
        this.coord.x = x;
        this.coord.y = y;
        this.coord.z = z;
    }
}

void main()
{
    auto foo = Foo(0, 0, 0);
}

if change Coord to
struct Coord
{
    double x, y, z;
}
the code compiles.

-- 
You are receiving this mail because:
You are watching all bug changes.
Apr 28 2015