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: