From d9e4524e06427e44a82b325667740618a1f70d2c Mon Sep 17 00:00:00 2001 From: Sebastian Wilzbach Date: Wed, 15 Aug 2018 12:16:34 +0200 Subject: [PATCH] Reorder abs constraints to avoid the integral promotion deprecation message --- std/math.d | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/std/math.d b/std/math.d index 4fa4ee91e..b537d468d 100644 --- a/std/math.d +++ b/std/math.d @@ -628,8 +628,8 @@ template isDeprecatedComplex(T) */ auto abs(Num)(Num x) if (!isDeprecatedComplex!Num && - (is(typeof(Num.init >= 0)) && is(typeof(-Num.init)) || - (is(Unqual!Num == short) || is(Unqual!Num == byte)))) + (is(Unqual!Num == short) || is(Unqual!Num == byte)) || + (is(typeof(Num.init >= 0)) && is(typeof(-Num.init)))) { static if (isFloatingPoint!(Num)) return fabs(x); @@ -723,7 +723,7 @@ static foreach (Num; AliasSeq!(cfloat, cdouble, creal, ifloat, idouble, ireal)) { return v; } - Vector!(float, 3) v; + Vector!(int, 3) v; assert(abs(v) == v); }