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

          Issue ID: 12929
           Summary: Empty union followed by field causes ICE due to offset
                    of 0.
           Product: D
           Version: D2
          Hardware: x86_64
                OS: All
            Status: NEW
          Keywords: ice, ice-on-valid-code
          Severity: normal
          Priority: P1
         Component: DMD
          Assignee: [email protected]
          Reporter: [email protected]

Sample:

struct Foo {
    union { }
    int bar;
}

Output:
dmd: argtypes.c:405: virtual void
toArgTypes(Type*)::ToArgTypes::visit(TypeStruct*): Assertion `t1 || f->offset
== 0' failed.
Aborted (core dumped)


While the above example is fairly useless seeming, it makes more sense with
variable length templates to generate a union.

--

Reply via email to