From 6a76011ecd33a45c4ba8b7dd24d0618b9fc85fb1 Mon Sep 17 00:00:00 2001
From: Tristan Gingold <tgingold@free.fr>
Date: Mon, 4 Nov 2019 18:54:26 +0100
Subject: synth-expr: allow constants in discrete range

---
 src/synth/synth-expr.adb | 2 ++
 1 file changed, 2 insertions(+)

(limited to 'src')

diff --git a/src/synth/synth-expr.adb b/src/synth/synth-expr.adb
index f6660db8b..c34616d14 100644
--- a/src/synth/synth-expr.adb
+++ b/src/synth/synth-expr.adb
@@ -532,6 +532,8 @@ package body Synth.Expr is
    begin
       L := Synth_Expression_With_Basetype (Syn_Inst, Get_Left_Limit (Rng));
       R := Synth_Expression_With_Basetype (Syn_Inst, Get_Right_Limit (Rng));
+      Strip_Const (L);
+      Strip_Const (R);
 
       if not (Is_Const (L) and Is_Const (R)) then
          Error_Msg_Synth (+Rng, "limits of range are not constant");
-- 
cgit v1.2.3