[Issue 12929] New: Empty union followed by field causes ICE due to offset of 0.

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Jun 16 00:41:36 PDT 2014


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: nobody at puremagic.com
          Reporter: opantm2+dbugs at gmail.com

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.

--


More information about the Digitalmars-d-bugs mailing list