aboutsummaryrefslogtreecommitdiffstats
path: root/src/synth/synth-decls.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-01-12 15:09:18 +0100
committerTristan Gingold <tgingold@free.fr>2020-01-12 15:09:18 +0100
commitf34371c33b486df225d29c3cc4902dc5adbcbc06 (patch)
tree9c2f7558941b87fd3f3c84f93815a18b5e4c8c80 /src/synth/synth-decls.adb
parent96c3a5d13e5444385dbc7b2e237b5a2765e26474 (diff)
downloadghdl-f34371c33b486df225d29c3cc4902dc5adbcbc06.tar.gz
ghdl-f34371c33b486df225d29c3cc4902dc5adbcbc06.tar.bz2
ghdl-f34371c33b486df225d29c3cc4902dc5adbcbc06.zip
synth: convert constant default value subtype. For #1080
Diffstat (limited to 'src/synth/synth-decls.adb')
-rw-r--r--src/synth/synth-decls.adb1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/synth/synth-decls.adb b/src/synth/synth-decls.adb
index f5c60d766..f59253ea1 100644
--- a/src/synth/synth-decls.adb
+++ b/src/synth/synth-decls.adb
@@ -476,6 +476,7 @@ package body Synth.Decls is
Obj_Type := Get_Value_Type (Syn_Inst, Decl_Type);
Val := Synth_Expression_With_Type
(Syn_Inst, Get_Default_Value (Decl), Obj_Type);
+ Val := Synth_Subtype_Conversion (Val, Obj_Type, True, Decl);
-- For constant functions, the value must be constant.
pragma Assert (not Get_Instance_Const (Syn_Inst)
or else Is_Static (Val));