Thread overview
[Issue 18349] std/math.d(543,33): Deprecation: integral promotion not done for -x
Feb 07, 2018
Timothee Cour
Feb 07, 2018
Basile B.
Feb 07, 2018
Basile B.
Feb 07, 2018
Basile B.
Feb 07, 2018
Basile B.
Mar 21, 2020
Basile-z
February 07, 2018
https://issues.dlang.org/show_bug.cgi?id=18349

Timothee Cour <timothee.cour2@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |timothee.cour2@gmail.com

--- Comment #1 from Timothee Cour <timothee.cour2@gmail.com> ---
IIRC: was triggered from dfmt by an input of type `immutable(short)` looks like logic breaks when input is immutable?


Num abs(Num)(Num x) @safe pure nothrow
if ((is(typeof(Num.init >= 0)) && is(typeof(-Num.init)) ||
    (is(Num == short) || is(Num == byte))) &&
    !(is(Num* : const(ifloat*)) || is(Num* : const(idouble*))
    || is(Num* : const(ireal*))))
{
    static if (isFloatingPoint!(Num))
        return fabs(x);
    else
    {
        static if (is(Num == short) || is(Num == byte))
            return x >= 0 ? x : cast(Num) -int(x);
        else
            return x >= 0 ? x : -x;
    }
}

--
February 07, 2018
https://issues.dlang.org/show_bug.cgi?id=18349

Basile B. <b2.temp@gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |b2.temp@gmx.com

--- Comment #2 from Basile B. <b2.temp@gmx.com> ---
Yeah nobody seen that "Unqual" is needed during the review.

https://github.com/dlang/phobos/pull/5958/files

I'm gonna handle this since i feel 50% responsible

--
February 07, 2018
https://issues.dlang.org/show_bug.cgi?id=18349

--- Comment #3 from Basile B. <b2.temp@gmx.com> ---
The constraint is already commented...

https://github.com/dlang/phobos/pull/6014 https://github.com/dlang/phobos/pull/6014/files#diff-8b9f1870415268a4c40b628d596dc405R549

Maybe the fix can be done anyway

--
February 07, 2018
https://issues.dlang.org/show_bug.cgi?id=18349

Basile B. <b2.temp@gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Hardware|x86                         |All
                 OS|Mac OS X                    |All

--
February 07, 2018
https://issues.dlang.org/show_bug.cgi?id=18349

Basile B. <b2.temp@gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #4 from Basile B. <b2.temp@gmx.com> ---
pull: https://github.com/dlang/phobos/pull/6135

--
February 07, 2018
https://issues.dlang.org/show_bug.cgi?id=18349

--- Comment #5 from github-bugzilla@puremagic.com ---
Commits pushed to master at https://github.com/dlang/phobos

https://github.com/dlang/phobos/commit/a2ab91ad483a18c277490fe2a6d725054ad39584 fix issue 18349 - std/math.d(543,33): Deprecation: integral promotion not done for -x

https://github.com/dlang/phobos/commit/9087e479618a2ad75960569cabfa75ce09255fd7 Merge pull request #6135 from BBasile/issue-18349

fix issue 18349 - std/math.d(543,33): Deprecation: integral promotion not done
for -x
merged-on-behalf-of: Steven Schveighoffer <schveiguy@users.noreply.github.com>

--
March 21, 2020
https://issues.dlang.org/show_bug.cgi?id=18349

Basile-z <b2.temp@gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|b2.temp@gmx.com             |

--