[Issue 4652] New: Compiler hangs on overloading variadic template + default argument

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Aug 15 20:29:20 PDT 2010


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

           Summary: Compiler hangs on overloading variadic template +
                    default argument
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: dsimcha at yahoo.com


--- Comment #0 from David Simcha <dsimcha at yahoo.com> 2010-08-15 20:29:17 PDT ---
The following code simply hangs DMD 2.048.  I haven't the slightest clue why.

struct Foo(Args...) if(Args.length > 1)
{
    Args args;
}

template Foo(Arg)
{
    alias Arg Foo;
}

Foo!(Args) getFoo(Args...)(Args args)
{
    static if(Args.length > 1)
    {
        return Foo!(Args)(args);
    }
    else
    {
        return args[0];
    }
}

Foo!(Args) getFoo(Args...)(Args args, uint num)
{
    static if(Args.length > 1)
    {
        return Foo!(Args)(args);
    }
    else
    {
        return args[0];
    }
}

void main()
{
    getFoo(1);
}

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