Bug 12929 – Empty union followed by field causes ICE due to offset of 0.

Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
All
Creation time
2014-06-16T07:41:36Z
Last change time
2017-12-18T22:57:48Z
Keywords
ice, pull
Assigned to
No Owner
Creator
Kapps
See also
https://issues.dlang.org/show_bug.cgi?id=18008

Comments

Comment #0 by opantm2+dbugs — 2014-06-16T07:41:36Z
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.
Comment #1 by k.hara.pg — 2014-11-03T04:35:44Z
Comment #2 by hsteoh — 2016-09-02T18:13:01Z
Doesn't happen on git HEAD anymore (at least not with the code posted here). Has recent compiler changes obscured this bug?
Comment #3 by slavo5150 — 2017-11-21T11:26:33Z
Comment #4 by github-bugzilla — 2017-11-25T00:28:28Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/1549c13be9b5d762123257234ec7e6d03cee62a2 Issue 12929 - Empty union followed by field causes ICE due to offset of 0(Tests Only) https://github.com/dlang/dmd/commit/01e2335b8253beff9c945b42ae7b5d7b14402d04 Merge pull request #7343 from JinShil/test_12929 Issue 12929 - Empty union followed by field causes ICE due to offset of 0(Tests Only) merged-on-behalf-of: Mike <[email protected]>
Comment #5 by github-bugzilla — 2017-12-18T22:57:48Z
Commits pushed to stable at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/1549c13be9b5d762123257234ec7e6d03cee62a2 Issue 12929 - Empty union followed by field causes ICE due to offset of 0(Tests Only) https://github.com/dlang/dmd/commit/01e2335b8253beff9c945b42ae7b5d7b14402d04 Merge pull request #7343 from JinShil/test_12929