[Issue 18016] using uninitialized value is considered @safe but has undefined behavior

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jun 11 00:08:21 UTC 2019


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

--- Comment #13 from ag0aep6g <ag0aep6g at gmail.com> ---
(In reply to Steven Schveighoffer from comment #12)
> I don't understand how the suggestion that the behavior is implementation
> defined doesn't jive with LLVM's chosen behavior.

As a whole, using an uninitialized variable wouldn't be implementation defined.
That would be silly. Walter's PR doesn't do that. It only says that the value
you get is up to the implementation. Everything else must work as usual.

So LLVM would have to give you some value. It wouldn't be allowed to just omit
the whole access and everything that depends on it (as it apparently does at
the moment).

--


More information about the Digitalmars-d-bugs mailing list