aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-01-14 18:26:38 +0100
committerTristan Gingold <tgingold@free.fr>2020-01-15 06:31:55 +0100
commitc15205285f62978e4551c749c392a8746258f92d (patch)
tree74bf795ea10d4c3986f08dbe9ede1a4d6d9fa105
parent30adf2657305b5ca1bcbd4e8f5f69b051f72ade9 (diff)
downloadghdl-c15205285f62978e4551c749c392a8746258f92d.tar.gz
ghdl-c15205285f62978e4551c749c392a8746258f92d.tar.bz2
ghdl-c15205285f62978e4551c749c392a8746258f92d.zip
vhdl: relax rule for choice expression staticness.
-rw-r--r--src/vhdl/vhdl-sem_stmts.adb9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/vhdl/vhdl-sem_stmts.adb b/src/vhdl/vhdl-sem_stmts.adb
index befb9b2fa..29845a471 100644
--- a/src/vhdl/vhdl-sem_stmts.adb
+++ b/src/vhdl/vhdl-sem_stmts.adb
@@ -1117,6 +1117,15 @@ package body Vhdl.Sem_Stmts is
if Flags.Vhdl_Std >= Vhdl_08 then
-- No specific restrictions in vhdl 2008.
null;
+ elsif Flags.Flag_Relaxed_Rules then
+ -- In relaxed mode, only check staticness of the expression
+ -- subtype, as the type of a prefix may not be locally static
+ -- while the type of the expression is.
+ if Get_Type_Staticness (Choice_Type) /= Locally then
+ Error_Msg_Sem
+ (+Choice, "choice subtype is not locally static");
+ return;
+ end if;
else
if not Check_Odcat_Expression (Choice) then
return;