December 02, 2022 [Issue 23534] New: __traits(isZeroInit) is true for enums with explicit values | ||||
|---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=23534 Issue ID: 23534 Summary: __traits(isZeroInit) is true for enums with explicit values Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity: blocker Priority: P1 Component: dmd Assignee: nobody@puremagic.com Reporter: teodor.dutu@gmail.com The second assert in the following code fails despite E.init being a, not 0. enum E { a = 1, b = 2 } void main() { assert(E.init != cast(E) 0); assert(!__traits(isZeroInit, E)); // this fails } This partially blocks https://github.com/dlang/dmd/pull/14664. -- | ||||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply