From 44bfdde1e96167f07b86b0dcd773931353a98ea7 Mon Sep 17 00:00:00 2001 From: Piotr Trojanek Date: Thu, 26 Aug 2021 17:35:27 +0200 Subject: [PATCH] [Ada] Fix missing check on slice with a subtype indication gcc/ada/ * sem_res.adb (Resolve_Slice): Handle range given as a subtype indication. --- gcc/ada/sem_res.adb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb index c493d5d..ba733a5 100644 --- a/gcc/ada/sem_res.adb +++ b/gcc/ada/sem_res.adb @@ -11360,7 +11360,11 @@ package body Sem_Res is Set_Parent (Dexpr, Parent (Drange)); Set_Sloc (Dexpr, Sloc (Drange)); - -- The discrete_range is a regular range. Resolve the bounds and remove + elsif Nkind (Drange) = N_Subtype_Indication then + Dexpr := Range_Expression (Constraint (Drange)); + + -- The discrete_range is a regular range (or a range attribute, which + -- will be resolved into a regular range). Resolve the bounds and remove -- their side effects. else -- 2.7.4