www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14146] New: [REG2.067a] ICE with non-empty default

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

          Issue ID: 14146
           Summary: [REG2.067a] ICE with non-empty default constructor in
                    struct
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: ice-on-invalid-code
          Severity: regression
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: sinkuupump gmail.com

Compiling the code below causes ICE. This is a regression introduced in
https://github.com/D-Programming-Language/dmd/pull/4281

struct RangeT(A)
{
    A[1] outer;
}

struct Array
{
    this()
    {
    }

    alias Range = RangeT!Array;

    bool opEquals(Array)
    {
    }
}


% dmd -c t.d
t.d(8): Error: constructor t.Array.this default constructor for structs only
allowed with  disable and no body
dmd: template.c:2593: FuncDeclaration*
TemplateDeclaration::doHeaderInstantiation(TemplateInstance*, Scope*,
FuncDeclaration*, Type*, Expressions*): Assertion `fd->type->ty == Tfunction'
failed.

--
Feb 07 2015