[Issue 7873] New: [2.059 beta] IFTI with inout does not properly match template parameter if called from inout function for pointers

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Apr 9 08:57:36 PDT 2012


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

           Summary: [2.059 beta] IFTI with inout does not properly match
                    template parameter if called from inout function for
                    pointers
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: schveiguy at yahoo.com


--- Comment #0 from Steven Schveighoffer <schveiguy at yahoo.com> 2012-04-09 08:58:18 PDT ---
This worked in 2.058:

inout(T) * foo(T)(inout(T)* t)
{
    static assert(is(T == int *));
    return t;
}

inout(T)* bar(T)(inout(T)* t)
{
    return foo(t);
}

void main()
{
    int *i;
    bar(&i);
}

It fails the assert in the 2.059 beta.

It seems to only happen if 'i' is a pointer, and only if foo is called with an
inout variable from an inout function.

Note that the function still compiles ( with typeof(t) == inout(int *)* ), it's
just that the T is not properly extracted using IFTI.  This has consequences if
you use T to create another template.

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