[Issue 18598] cyclic constructor calls have undefined behavior but are accepted in @safe code

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Mar 20 07:03:43 UTC 2018


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

Walter Bright <bugzilla at digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla at digitalmars.com

--- Comment #1 from Walter Bright <bugzilla at digitalmars.com> ---
I don't know a way to assign defined behavior to overflowing the stack :-(

This can, however, be statically detected by the compiler by keeping track of
the calls between constructors. (They can't be virtual, so that'll work as long
as all the constructor bodies are visible to the compiler.)

--


More information about the Digitalmars-d-bugs mailing list