diff options
author | Tristan Gingold <tgingold@free.fr> | 2019-12-24 18:11:01 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2019-12-24 18:11:01 +0100 |
commit | 2274e49872de5df0eedfc1a2db5bd0156ad161e9 (patch) | |
tree | b7d5aed13d0d63a6455414a2521fa14459d94c09 /src | |
parent | 0c8d0c455f12bf59a1d0b2c1eefddd1a319efe00 (diff) | |
download | ghdl-2274e49872de5df0eedfc1a2db5bd0156ad161e9.tar.gz ghdl-2274e49872de5df0eedfc1a2db5bd0156ad161e9.tar.bz2 ghdl-2274e49872de5df0eedfc1a2db5bd0156ad161e9.zip |
vhdl: handle non-object aliases in selected use clause. Fix #1057
Diffstat (limited to 'src')
-rw-r--r-- | src/vhdl/vhdl-sem_scopes.adb | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/vhdl/vhdl-sem_scopes.adb b/src/vhdl/vhdl-sem_scopes.adb index ac97bbeb0..3e4633a58 100644 --- a/src/vhdl/vhdl-sem_scopes.adb +++ b/src/vhdl/vhdl-sem_scopes.adb @@ -1459,7 +1459,9 @@ package body Vhdl.Sem_Scopes is -- that simple name, character literal, or operator symbol contained -- within the package or library denoted by the prefix of the selected -- name. - procedure Use_Selected_Name (Name : Iir) is + procedure Use_Selected_Name (Name : Iir) + is + Nname : Iir; begin case Get_Kind (Name) is when Iir_Kind_Overload_List => @@ -1473,10 +1475,11 @@ package body Vhdl.Sem_Scopes is -- If the suffix of the selected name is a type mark, then the -- declaration of the type or subtype denoted by the type mark -- is identified. Moreover [...] - if (Vhdl_Std >= Vhdl_08 or else Flag_Relaxed_Rules) - and then Get_Kind (Name) in Iir_Kinds_Type_Declaration - then - Use_Selected_Type_Name (Name); + if (Vhdl_Std >= Vhdl_08 or else Flag_Relaxed_Rules) then + Nname := Strip_Non_Object_Alias (Name); + if Get_Kind (Nname) in Iir_Kinds_Type_Declaration then + Use_Selected_Type_Name (Nname); + end if; end if; end case; end Use_Selected_Name; |