================
@@ -102,7 +102,7 @@ inline bool operator>=(const Fraction &x, const Fraction 
&y) {
 inline Fraction reduce(const Fraction &f) {
   if (f == Fraction(0))
     return Fraction(0, 1);
-  MPInt g = gcd(f.num, f.den);
+  MPInt g = gcd(abs(f.num), abs(f.den));
   return Fraction(f.num / g, f.den / g);
 }
----------------
Superty wrote:

If this is a bug fix please submit it as a separate patch along with a test 
case.

https://github.com/llvm/llvm-project/pull/67382
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to