From c15205285f62978e4551c749c392a8746258f92d Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Tue, 14 Jan 2020 18:26:38 +0100 Subject: vhdl: relax rule for choice expression staticness. --- src/vhdl/vhdl-sem_stmts.adb | 9 +++++++++ 1 file changed, 9 insertions(+) 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; -- cgit v1.2.3