From 7efd2f566be98c1052a3276ec0a308aaef72de7a Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Tue, 29 Sep 2020 07:56:24 +0200 Subject: vhdl-sem_types: improve error handling on index subtypes. Fix #1473 --- src/vhdl/vhdl-sem_types.adb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/vhdl/vhdl-sem_types.adb b/src/vhdl/vhdl-sem_types.adb index d669c170d..3a60b18eb 100644 --- a/src/vhdl/vhdl-sem_types.adb +++ b/src/vhdl/vhdl-sem_types.adb @@ -1051,9 +1051,13 @@ package body Vhdl.Sem_Types is -- Index_Name is a subtype_indication, which can be a type_mark. else -- Avoid errors. - Index_Name := - Build_Simple_Name (Natural_Subtype_Declaration, Index_Type); - Set_Type (Index_Name, Natural_Subtype_Definition); + Index_Name := Create_Iir (Iir_Kind_Integer_Subtype_Definition); + Location_Copy (Index_Name, Index_Type); + Set_Range_Constraint + (Index_Name, + Create_Error_Expr (Index_Type, Integer_Subtype_Definition)); + Set_Parent_Type (Index_Name, Integer_Subtype_Definition); + Set_Type_Staticness (Index_Name, Globally); end if; Set_Nth_Element (Index_List, I, Index_Name); -- cgit v1.2.3