[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 01:16:03 UTC 2019


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

--- Comment #15 from Steven Schveighoffer <schveiguy at yahoo.com> ---
(In reply to ag0aep6g from comment #13)

> 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).

How would it omit the return statement?

The code above seems to compile with ldc and writeln(f()) seems to print
something (0 in fact on my test). Where is the omission? Not saying your
assertion is false, I just don't understand how it can omit everything that
depends on an access of uninitialized data.

--


More information about the Digitalmars-d-bugs mailing list