]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Fix Forced sign flag in formatted string
authorMarc Poulhiès <poulhies@adacore.com>
Tue, 22 Mar 2022 09:08:46 +0000 (10:08 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Tue, 17 May 2022 08:25:46 +0000 (08:25 +0000)
Fix the Forced sign flag that is incorrectly ignored for scientific
notation and shortest representation.

gcc/ada/

* libgnat/g-forstr.adb (Is_Number): Add scientific notation and
shortest representation.

gcc/ada/libgnat/g-forstr.adb

index 8ce8d1cffd3027ac9137199f0a944ce0e7543e06..8821de6f2800ad22b24483d11a8643e977191a8e 100644 (file)
@@ -58,7 +58,7 @@ package body GNAT.Formatted_String is
 
    type Sign_Kind is (Neg, Zero, Pos);
 
-   subtype Is_Number is F_Kind range Decimal_Int .. Decimal_Float;
+   subtype Is_Number is F_Kind range Decimal_Int .. Shortest_Decimal_Float_Up;
 
    type F_Sign is (If_Neg, Forced, Space) with Default_Value => If_Neg;