[Ada] Simplify type conversions in source pointer arithmetic
authorPiotr Trojanek <trojanek@adacore.com>
Tue, 7 Dec 2021 19:13:15 +0000 (20:13 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Thu, 6 Jan 2022 17:11:37 +0000 (17:11 +0000)
gcc/ada/

* sem_res.adb (Resolve_String_Literal): Simplify pointer
arithmetic.

gcc/ada/sem_res.adb

index d8784f1..9a63506 100644 (file)
@@ -11737,7 +11737,7 @@ package body Sem_Res is
                         Apply_Compile_Time_Constraint_Error
                           (N, "character out of range??",
                            CE_Range_Check_Failed,
-                           Loc => Source_Ptr (Int (Loc) + J));
+                           Loc => Loc + Source_Ptr (J));
                      end if;
                   end loop;