]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Handle unchecked conversion in bound
authorRichard Kenner <kenner@adacore.com>
Fri, 3 Nov 2023 22:04:59 +0000 (18:04 -0400)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 28 Nov 2023 09:35:47 +0000 (10:35 +0100)
Look through both unchecked and normal conversions when seeing if any
part of a bound is uplevel.

gcc/ada/

* exp_unst.adb (Note_Uplevel_Bound): Treat
N_Unchecked_Type_Conversion like N_Type_Conversion.

gcc/ada/exp_unst.adb

index b01cfc13bf96a4aaf1f721535e596bfb702148ec..7acb0656262b61acabf17e9cc24cb36d05aa9fae 100644 (file)
@@ -643,7 +643,9 @@ package body Exp_Unst is
 
                   --  Conversion case
 
-                  elsif Nkind (N) = N_Type_Conversion then
+                  elsif Nkind (N) in
+                          N_Type_Conversion | N_Unchecked_Type_Conversion
+                  then
                      Note_Uplevel_Bound (Expression (N), Ref);
                   end if;
                end Note_Uplevel_Bound;