From 80e3412f4fa5f55804bd1c23dcf478f55574c907 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Wed, 7 Jan 2015 00:15:46 +0000 Subject: [PATCH] compiler: Add explicit sign to exported complex constants without imaginary component. Fixes issue 31. From-SVN: r219273 --- gcc/go/gofrontend/expressions.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/go/gofrontend/expressions.cc b/gcc/go/gofrontend/expressions.cc index ccb472bed30..d386b81ce17 100644 --- a/gcc/go/gofrontend/expressions.cc +++ b/gcc/go/gofrontend/expressions.cc @@ -2450,7 +2450,7 @@ Complex_expression::export_complex(String_dump* exp, const mpc_t val) if (!mpfr_zero_p(mpc_realref(val))) { Float_expression::export_float(exp, mpc_realref(val)); - if (mpfr_sgn(mpc_imagref(val)) > 0) + if (mpfr_sgn(mpc_imagref(val)) >= 0) exp->write_c_string("+"); } Float_expression::export_float(exp, mpc_imagref(val)); -- 2.30.2