Bug 6186

Kenji Hara k.hara.pg at gmail.com
Wed Oct 2 11:43:31 PDT 2013


If the given argument to the out parameter is not correctly initialized
(eg. void initialized variable), calling dtor for the argument is
absolutely unsafe. That's the reason why my patch was rejected by Walter.

Alternative language semantics in my thought is:
---
If an out parameter typed T exists, and
  1. T has elaborate destructor
  2. T.init represents logically invalid object (T is nested struct, and/or
T has @disable this();)
Automatic blit initializing for the out parameter would be unsafe.

So semantic analysis would reject such a out parameter declaration.
---

But I'm still not sure the rule is enough useful for many cases...

Kenji Hara

2013/10/3 Benjamin Thaut <code at benjamin-thaut.de>

> http://d.puremagic.com/issues/**show_bug.cgi?id=6186<http://d.puremagic.com/issues/show_bug.cgi?id=6186>
>
> This bug is open since two years and nothing has happend so far.
>
> If you look at it its really funny:
>
> Kenji: Heres a Bug and a fix
> Walter: I don't like your fix but I don't have a better idea
> Kenji: closes pull request
> -- silence -- (for over 2 years)
>
> We should really find a solution for this problem.
>
> Kind Regards
> Benjamin Thaut
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20131003/17244175/attachment.html>


More information about the Digitalmars-d mailing list