From bf27a800fb066a282b9f612be293bd02a5bb0545 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Wed, 11 Jan 2023 05:41:41 +0100 Subject: vhdl-configuration: relax top-level unit restrictions Allow generics without default values if the type is fully constrained --- src/vhdl/vhdl-configuration.adb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/vhdl') diff --git a/src/vhdl/vhdl-configuration.adb b/src/vhdl/vhdl-configuration.adb index 64a615bfb..9777cca6a 100644 --- a/src/vhdl/vhdl-configuration.adb +++ b/src/vhdl/vhdl-configuration.adb @@ -888,10 +888,11 @@ package body Vhdl.Configuration is while El /= Null_Iir loop case Iir_Kinds_Interface_Declaration (Get_Kind (El)) is when Iir_Kinds_Interface_Object_Declaration => - if Get_Default_Value (El) = Null_Iir then - if not (Enable_Override and Allow_Generic_Override (El)) then - Error (El, "(%n has no default value)", +El); - end if; + if Get_Default_Value (El) = Null_Iir + and then not Is_Fully_Constrained_Type (Get_Type (El)) + and then not (Enable_Override and Allow_Generic_Override (El)) + then + Error (El, "(%n has no default value)", +El); end if; when Iir_Kinds_Interface_Subprogram_Declaration => Error (El, "(%n is a subprogram generic)", +El); -- cgit v1.2.3