aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch3.adb
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2020-06-22 13:48:43 +0200
committerPierre-Marie de Rodat <derodat@adacore.com>2020-10-15 05:39:08 -0400
commit38e5d9c57fdbb101014e6e55843e2714c3d2cd49 (patch)
treeffeaec78548d72ecd097c979d3dcd3a9582118dc /gcc/ada/sem_ch3.adb
parent8ad6af8fc9f0b5df3a6a5f08a95651014fc946df (diff)
downloadgcc-38e5d9c57fdbb101014e6e55843e2714c3d2cd49.zip
gcc-38e5d9c57fdbb101014e6e55843e2714c3d2cd49.tar.gz
gcc-38e5d9c57fdbb101014e6e55843e2714c3d2cd49.tar.bz2
[Ada] Fix range check on constrained array with expanded index name
gcc/ada/ * sem_ch3.adb (Analyze_Subtype_Declaration): Recognize both identifiers and expanded names; use high-level Is_Scalar_Type instead of low-level membership test.
Diffstat (limited to 'gcc/ada/sem_ch3.adb')
-rw-r--r--gcc/ada/sem_ch3.adb4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
index a5690d6..8581938 100644
--- a/gcc/ada/sem_ch3.adb
+++ b/gcc/ada/sem_ch3.adb
@@ -5829,8 +5829,8 @@ package body Sem_Ch3 is
Target_Index := First_Index (Indic_Typ);
while Present (Subt_Index) loop
- if ((Nkind (Subt_Index) = N_Identifier
- and then Ekind (Entity (Subt_Index)) in Scalar_Kind)
+ if ((Nkind (Subt_Index) in N_Expanded_Name | N_Identifier
+ and then Is_Scalar_Type (Entity (Subt_Index)))
or else Nkind (Subt_Index) = N_Subtype_Indication)
and then
Nkind (Scalar_Range (Etype (Subt_Index))) = N_Range