If you could make any changes to D, what would they look like?
Paul Backus
snarwin at gmail.com
Thu Oct 28 14:49:41 UTC 2021
On Wednesday, 27 October 2021 at 19:40:10 UTC, Dukc wrote:
> On Wednesday, 27 October 2021 at 19:31:52 UTC, H. S. Teoh wrote:
>>
>> Returning a void-initialized (i.e., *un*initialized) result
>> invokes UB.
>> The compiler is free to do (or not do) whatever it wants in
>> this case.
>>
>>
>> T
>
> Only if the result contains pointers. With other types, the
> result is undefined but not the rest of the program.
According to the current language spec, the entire program has
undefined behavior whether or not the result contains pointers.
Walter has proposed to change this [1], but the proposal has not
been accepted.
[1]: https://github.com/dlang/dlang.org/pull/2260
More information about the Digitalmars-d
mailing list