www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13351] New: IFTI for `in` parameter doesn't strip const

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

          Issue ID: 13351
           Summary: IFTI for `in` parameter doesn't strip const
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: safety0ff.bugz gmail.com

///////////// test.d /////////////
T add(T)(in T x, in T y)
{
        T z;
        z = x + y;
        return z;
}

void main()
{
        const double a = 1.0;
        const double b = 2.0;
        double c;
        c = add(a,b);
}
//////////////////////////////////

Introduced in 2.066 beta 6

Digger output:
b757a099a65cc66ed5cbb8f84468e5bd924f5d3a is the first bad commit
commit b757a099a65cc66ed5cbb8f84468e5bd924f5d3a
Author: Hara Kenji <k.hara.pg+dev gmail.com>
Date:   Thu Jul 24 00:35:33 2014 +0900



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

    Cherry-picking commits from master to 2.066 branch (for beta6)

--
Aug 21 2014