diff options
author | Tristan Gingold <tgingold@free.fr> | 2023-01-26 07:40:39 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2023-01-26 21:56:30 +0100 |
commit | 05b878423c734323a4d2e498652f0b746c03c7e7 (patch) | |
tree | 10b819e27f55d80e94920930d9a5880bd458343f /src | |
parent | 74c048cdb4b19d41f70880ebf3d3e6eb58404097 (diff) | |
download | ghdl-05b878423c734323a4d2e498652f0b746c03c7e7.tar.gz ghdl-05b878423c734323a4d2e498652f0b746c03c7e7.tar.bz2 ghdl-05b878423c734323a4d2e498652f0b746c03c7e7.zip |
vhdl-sem_decls: allow use on non-elaborated functions in generic types
Diffstat (limited to 'src')
-rw-r--r-- | src/vhdl/vhdl-sem_decls.adb | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/vhdl/vhdl-sem_decls.adb b/src/vhdl/vhdl-sem_decls.adb index 31d6ef6fe..47f77e917 100644 --- a/src/vhdl/vhdl-sem_decls.adb +++ b/src/vhdl/vhdl-sem_decls.adb @@ -203,7 +203,8 @@ package body Vhdl.Sem_Decls is procedure Sem_Interface_Object_Declaration (Inter, Last : Iir; Interface_Kind : Interface_Kind_Type) is - Prev_Unelaborated_Use_Allowed : Boolean; + Prev_Unelaborated_Use_Allowed : constant Boolean := + Unelaborated_Use_Allowed; A_Type: Iir; Default_Value: Iir; begin @@ -223,17 +224,22 @@ package body Vhdl.Sem_Decls is Set_Subtype_Indication (Inter, Get_Subtype_Indication (Last)); end if; else + if Interface_Kind = Port_Interface_List then + Unelaborated_Use_Allowed := True; + end if; + A_Type := Sem_Subtype_Indication (A_Type); Set_Subtype_Indication (Inter, A_Type); A_Type := Get_Type_Of_Subtype_Indication (A_Type); Set_Type (Inter, A_Type); + Unelaborated_Use_Allowed := Prev_Unelaborated_Use_Allowed; + Default_Value := Get_Default_Value (Inter); if Default_Value /= Null_Iir and then not Is_Error (A_Type) then Deferred_Constant_Allowed := True; - Prev_Unelaborated_Use_Allowed := Unelaborated_Use_Allowed; - if Interface_Kind in Parameter_Interface_List then + if Interface_Kind /= Generic_Interface_List then Unelaborated_Use_Allowed := True; end if; |