March 06, 2019 [Issue 19720] const structs without explicit initializer are not usable in CTFE expressions | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=19720 Simen Kjaeraas <simen.kjaras@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |simen.kjaras@gmail.com Resolution|--- |INVALID --- Comment #1 from Simen Kjaeraas <simen.kjaras@gmail.com> --- This is intended behavior - a const variable with an initializer has a known value at compile time, while one without is expected to be initialized in a static constructor, and using its value before that point is undefined behavior. -- |
Copyright © 1999-2021 by the D Language Foundation