diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2020-06-25 21:48:51 +0200 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2020-10-16 03:31:21 -0400 |
commit | 5540812a4d623975660159172d3cf4241ead8494 (patch) | |
tree | 7d95de97e974c221c6341b80d8b4b0cf014c0bc6 /gcc/ada/sem_ch3.adb | |
parent | 2c061483126ebd8e3afdb784f150fa16c677ba14 (diff) | |
download | gcc-5540812a4d623975660159172d3cf4241ead8494.zip gcc-5540812a4d623975660159172d3cf4241ead8494.tar.gz gcc-5540812a4d623975660159172d3cf4241ead8494.tar.bz2 |
[Ada] Unique itypes names for unconstrained array object declaration
gcc/ada/
* sem_ch3.adb (Array_Type_Declaration): Create itype with unique
name.
Diffstat (limited to 'gcc/ada/sem_ch3.adb')
-rw-r--r-- | gcc/ada/sem_ch3.adb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index dc276df..8fe118b 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -6141,7 +6141,12 @@ package body Sem_Ch3 is -- Constrained array case if No (T) then - T := Create_Itype (E_Void, P, Related_Id, 'T'); + -- We might be creating more than one itype with the same Related_Id, + -- e.g. for an array object definition and its initial value. Give + -- them unique suffixes, because GNATprove require distinct types to + -- have different names. + + T := Create_Itype (E_Void, P, Related_Id, 'T', Suffix_Index => -1); end if; if Nkind (Def) = N_Constrained_Array_Definition then |