www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 15985] New: [REG2.068/2.069] Code doesn't link unless

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

          Issue ID: 15985
           Summary: [REG2.068/2.069] Code doesn't link unless compiled
                    with -debug
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: link-failure
          Severity: regression
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: thecybershadow gmail.com

/////////////////////// test.d ///////////////////////
struct S()
{
    void delegate() d;
}

S!() f_Ds(U=D*)()
{
    static if (is(U == struct))
        return S!()
            (
                {
                    foreach (i, field; U.init.tupleof)
                        f_Ds!(typeof(field))();
                }
            );

    static if (is(U V : V*))
        return f_Ds!V();
}

void f_E()()
{
    auto f = S!()
        (
            {
                enum x = is(typeof(f_Ds!(D*)()));
                f_Ds!(D*)();
            }
        );
}

struct A
{
    D* d;
}

struct B
{
}

struct C
{
    A a;
    B b;
}

struct D
{
    C c;
}

void main()
{
    f_E();
    f_Ds!D();
}
//////////////////////////////////////////////////////

Linux  , DMD 2.068.0, with    -debug: OK
Linux  , DMD 2.068.0, without -debug: OK
Linux  , DMD 2.069.0, with    -debug: OK
Linux  , DMD 2.069.0, without -debug: Link error

Windows, DMD 2.067.0, with    -debug: OK
Windows, DMD 2.067.0, without -debug: OK
Windows, DMD 2.068.0, with    -debug: OK
Windows, DMD 2.068.0, without -debug: Link error

Bisection attempts point towards master/stable branch merges (i.e. nothing
useful).

It is probably a latent heisenbug triggered by other changes.

Downstream issue: https://github.com/CyberShadow/Digger/issues/36

--
May 02 2016