aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/exp_ch5.adb
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2020-04-24 22:05:35 +0200
committerPierre-Marie de Rodat <derodat@adacore.com>2020-06-18 05:08:35 -0400
commit4bfab79a72afbe0f6232668fdfa4b56a6aaea2e6 (patch)
tree0eb7817062f22f81cf24f5c5c5e18a4a7b35f83e /gcc/ada/exp_ch5.adb
parentb93d80bc8fc58c4ef746a8ddc699167c3ededfb9 (diff)
downloadgcc-4bfab79a72afbe0f6232668fdfa4b56a6aaea2e6.zip
gcc-4bfab79a72afbe0f6232668fdfa4b56a6aaea2e6.tar.gz
gcc-4bfab79a72afbe0f6232668fdfa4b56a6aaea2e6.tar.bz2
[Ada] Small cleanup in constraint checking code for allocators
2020-06-18 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * exp_ch4.adb (Expand_Allocator_Expression): Apply constraint and predicate checks for the qualified expression on entry, followed by constraint and predicate checks for the allocator itself, and return early if this results in a static error. (Expand_N_Allocator): Do not do the same here. Instead apply constraint and predicate checks for arrays in the subtype indication case. * exp_ch5.adb (Expand_N_Assignment_Statement): Do not apply range checks to allocators here.
Diffstat (limited to 'gcc/ada/exp_ch5.adb')
-rw-r--r--gcc/ada/exp_ch5.adb20
1 files changed, 0 insertions, 20 deletions
diff --git a/gcc/ada/exp_ch5.adb b/gcc/ada/exp_ch5.adb
index fd51dfa..db2ab18 100644
--- a/gcc/ada/exp_ch5.adb
+++ b/gcc/ada/exp_ch5.adb
@@ -2447,26 +2447,6 @@ package body Exp_Ch5 is
if Is_Constrained (Etype (Lhs)) then
Apply_Length_Check (Rhs, Etype (Lhs));
end if;
-
- if Nkind (Rhs) = N_Allocator then
- declare
- Target_Typ : constant Entity_Id := Etype (Expression (Rhs));
- C_Es : Check_Result;
-
- begin
- C_Es :=
- Get_Range_Checks
- (Lhs,
- Target_Typ,
- Etype (Designated_Type (Etype (Lhs))));
-
- Insert_Range_Checks
- (C_Es,
- N,
- Target_Typ,
- Sloc (Lhs));
- end;
- end if;
end if;
-- Apply range check for access type case