diff options
author | Tristan Gingold <tgingold@free.fr> | 2023-01-11 05:41:41 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2023-01-11 05:41:41 +0100 |
commit | bf27a800fb066a282b9f612be293bd02a5bb0545 (patch) | |
tree | 2c162f6cb2d67d3468de0099e5ca42d2ee181b48 /src/vhdl | |
parent | 9292b6304ffa761b224aacb50f1f58a73bedbad7 (diff) | |
download | ghdl-bf27a800fb066a282b9f612be293bd02a5bb0545.tar.gz ghdl-bf27a800fb066a282b9f612be293bd02a5bb0545.tar.bz2 ghdl-bf27a800fb066a282b9f612be293bd02a5bb0545.zip |
vhdl-configuration: relax top-level unit restrictions
Allow generics without default values if the type is fully constrained
Diffstat (limited to 'src/vhdl')
-rw-r--r-- | src/vhdl/vhdl-configuration.adb | 9 |
1 files changed, 5 insertions, 4 deletions
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); |