From 1c8b894c429a29a34ac251c5536ececd18bac048 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Tue, 12 May 2015 22:42:22 +0200 Subject: Always report pure rules violation, but as a warning in 93c or -frelaxed-rules For ticket 57. --- src/vhdl/sem_names.adb | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'src/vhdl/sem_names.adb') diff --git a/src/vhdl/sem_names.adb b/src/vhdl/sem_names.adb index d7bb8c4..6299826 100644 --- a/src/vhdl/sem_names.adb +++ b/src/vhdl/sem_names.adb @@ -1235,7 +1235,7 @@ package body Sem_Names is procedure Error_Pure (Subprg : Iir; Obj : Iir) is begin - Error_Msg_Sem + Error_Msg_Sem_Relaxed ("reference to " & Disp_Node (Obj) & " violate pure rule for " & Disp_Node (Subprg), Loc); end Error_Pure; @@ -1288,14 +1288,12 @@ package body Sem_Names is -- -- A pure function must not contain a reference to an explicitly -- declared file. - if Flags.Vhdl_Std > Vhdl_93c then - if Get_Kind (Subprg) = Iir_Kind_Function_Declaration then - Error_Pure (Subprg, Obj); - else - Set_Purity_State (Subprg, Impure); - Set_Impure_Depth (Get_Subprogram_Body (Subprg), - Iir_Depth_Impure); - end if; + if Get_Kind (Subprg) = Iir_Kind_Function_Declaration then + Error_Pure (Subprg, Obj); + else + Set_Purity_State (Subprg, Impure); + Set_Impure_Depth (Get_Subprogram_Body (Subprg), + Iir_Depth_Impure); end if; return; when others => -- cgit