www.digitalmars.com         C & C++   DMDScript  

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

reply d-bugmail puremagic.com writes:
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 puremagic.com
        ReportedBy: schveiguy yahoo.com



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: -------
Apr 09 2012
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7873


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull, rejects-valid




https://github.com/D-Programming-Language/dmd/pull/800

A pull to fix this issue.
https://github.com/D-Programming-Language/dmd/pull/872

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 09 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7873




Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/7c22b8af8041a97c74e87a6e941ef14bb49905b6


Issue 7873 - IFTI with inout does not properly match template parameter if
called from inout function for pointers

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 09 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7873


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla digitalmars.com
         Resolution|                            |FIXED


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 09 2012