[Ada] Bug in Enum_Subtype'Image in Ada 2020 mode
authorBob Duff <duff@adacore.com>
Thu, 18 Jun 2020 13:10:33 +0000 (09:10 -0400)
committerPierre-Marie de Rodat <derodat@adacore.com>
Mon, 27 Jul 2020 08:05:20 +0000 (04:05 -0400)
gcc/ada/

* exp_imgv.adb (Expand_Image_Attribute): Add Root_Type, so
constrained subtypes work.

gcc/ada/exp_imgv.adb

index 8cad1020a4fe5c6ecea7565718b24404f8e96e2d..41e4b1b454e76c79bdf53fda23f936eee185b1d3 100644 (file)
@@ -483,7 +483,7 @@ package body Exp_Imgv is
       --  underlying type.
 
       if Ada_Version >= Ada_2020 then
-         Rtyp := Underlying_Type (Ptyp);
+         Rtyp := Underlying_Type (Root_Type (Ptyp));
       else
          Rtyp := Root_Type (Ptyp);
       end if;