]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Fix missing minus sign in literal translation
authorGhjuvan Lacambre <lacambre@adacore.com>
Wed, 28 Apr 2021 09:03:03 +0000 (11:03 +0200)
committerPierre-Marie de Rodat <derodat@adacore.com>
Mon, 5 Jul 2021 13:09:13 +0000 (13:09 +0000)
gcc/ada/

* sem_res.adb (Resolve): Insert minus sign if needed.

gcc/ada/sem_res.adb

index fb40484f2a6314ca692a5ed5e5355ae8309186a4..494904faa55b4419ec4ad24caa0f4646d14cd8af 100644 (file)
@@ -2934,6 +2934,11 @@ package body Sem_Res is
                      else
                         UI_Image (Norm_Num (Expr_Value_R (Expr)), Decimal);
                         Start_String;
+
+                        if UR_Is_Negative (Expr_Value_R (Expr)) then
+                           Store_String_Chars ("-");
+                        end if;
+
                         Store_String_Chars
                           (UI_Image_Buffer (1 .. UI_Image_Length));
                         Param1 := Make_String_Literal (Loc, End_String);