[Issue 10186] default construction is disabled even if default ctor declared

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon May 27 15:44:57 PDT 2013


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


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |


--- Comment #3 from Kenji Hara <k.hara.pg at gmail.com> 2013-05-27 15:44:56 PDT ---
(In reply to comment #1)
> https://github.com/D-Programming-Language/dmd/pull/2087

The fix is incomplete.

struct S
{
    @disable this();
    this(int i) {}
}

class C
{
    S s;   // move definition before the ctor

    this() { s = S(1); }
}

void main()
{
    auto c = new C;  // line 16
}

test.d(16): Error: default construction is disabled for type C

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