From 278802df9706d2b8ffa6731da110cdfb9be1ce7a Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Thu, 16 Mar 2017 06:57:24 +0100 Subject: Allow function declaration to be a prefix of array attribute. Fix #320 --- src/vhdl/sem_names.adb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/vhdl/sem_names.adb b/src/vhdl/sem_names.adb index ca882c8db..674ffb4ec 100644 --- a/src/vhdl/sem_names.adb +++ b/src/vhdl/sem_names.adb @@ -982,6 +982,14 @@ package body Sem_Names is Prefix := Sem_Type_Mark (Prefix_Name); else Prefix := Finish_Sem_Name (Prefix_Name, Get_Prefix (Attr)); + -- Convert function declaration to call. + if Get_Kind (Prefix) in Iir_Kinds_Denoting_Name + and then + (Get_Kind (Get_Named_Entity (Prefix)) + = Iir_Kind_Function_Declaration) + then + Prefix := Function_Declaration_To_Call (Prefix); + end if; end if; Set_Prefix (Attr, Prefix); -- cgit v1.2.3