[Issue 17036] New: Template default parametr does not works correctly

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Dec 27 12:23:31 PST 2016


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

          Issue ID: 17036
           Summary: Template default parametr does not works correctly
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: kozzi11 at gmail.com

dmd does not accept .init for struct with void[] fields at template default
parametr


example:

struct S
{
    void[16] x;
}


auto TMPL(T, T init = T.init)()
{
    return init;
}

auto TMPL2(T)()
{
    T init = T.init;
    return init;
}

void main()
{    
    TMPL!(S)(); // does not work
    TMPL2!(S)(); // works ok as expected
}

--


More information about the Digitalmars-d-bugs mailing list