[Issue 10630] Structs with disabled default construction can't be used as `out` parameters

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Sep 1 18:53:19 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=10630


Kenji Hara <k.hara.pg at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |accepts-invalid, pull
           Severity|regression                  |major


--- Comment #2 from Kenji Hara <k.hara.pg at gmail.com> 2013-09-01 18:53:16 PDT ---
(In reply to comment #1)
> This has been a regression since at least 2.063.2. git bisect shows that the
> bad commit was:
> 
> 0275c56cbaa09d6ec49e978bd011eb5b0a9b62aa
>     Merge pull request #2052 from 9rnsr/fix10115
> 
>     Issue 10115 - More @disabled holes

This is not a true regression, because the combination of out parameter +
disabled default construction struct is essentially invalid.

http://dlang.org/function#parameters
"parameter is initialized upon function entry with the default value for its
type"

Such struct does not have "default value", because its construction always
needs explicit constructor call with one or more arguments.

>From 2.063, such function call was made invalid, but the declaration is still
accepted. Therefore this issue should be marked an "accepts-invalid".

Compiler fix:
https://github.com/D-Programming-Language/dmd/pull/2510

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list