diff options
author | Tristan Gingold | 2015-05-19 06:35:54 +0200 |
---|---|---|
committer | Tristan Gingold | 2015-05-19 06:35:54 +0200 |
commit | e6155f916a818b1cad10f206e874f4857d871ce0 (patch) | |
tree | 030a175f31ce9aa5e69065e65604ee86e266a085 /src | |
parent | ba52970ab95b84f5495f5c6e389f7bd503eec392 (diff) | |
download | ghdl-e6155f916a818b1cad10f206e874f4857d871ce0.tar.gz ghdl-e6155f916a818b1cad10f206e874f4857d871ce0.tar.bz2 ghdl-e6155f916a818b1cad10f206e874f4857d871ce0.zip |
Do not consider overriden implicit declaration is reference by selection.
Fix ticket 69.
Diffstat (limited to 'src')
-rw-r--r-- | src/vhdl/sem_names.adb | 6 | ||||
-rw-r--r-- | src/vhdl/sem_scopes.adb | 16 |
2 files changed, 20 insertions, 2 deletions
diff --git a/src/vhdl/sem_names.adb b/src/vhdl/sem_names.adb index 6d35467..571bc7c 100644 --- a/src/vhdl/sem_names.adb +++ b/src/vhdl/sem_names.adb @@ -331,7 +331,9 @@ package body Sem_Names is end if; end if; when others => - if Get_Identifier (Decl) = Id then + -- Consider only visible declarations (case of an implicit + -- declaration that is overriden by explicit one). + if Get_Identifier (Decl) = Id and Get_Visible_Flag (Decl) then Add_Result (Res, Decl); end if; end case; @@ -790,7 +792,7 @@ package body Sem_Names is Set_Implementation (Call, Get_Named_Entity (Prefix)); -- LRM08 8.1 Names - -- The name is a simple name or seleted name that does NOT denote a + -- The name is a simple name or selected name that does NOT denote a -- function call [...] -- -- GHDL: so function calls are never static names. diff --git a/src/vhdl/sem_scopes.adb b/src/vhdl/sem_scopes.adb index 2922ea9..442da38 100644 --- a/src/vhdl/sem_scopes.adb +++ b/src/vhdl/sem_scopes.adb @@ -749,6 +749,22 @@ package body Sem_Scopes is Decl); return; end if; + + if not Is_Decl_Implicit and Is_Current_Decl_Implicit + then + -- DECL 'overrides' the predefined current + -- declaration. + + -- LRM93 10.3 Visibility + -- In such cases, a predefined operation is always + -- hidden by the other homograph. Where hidden in + -- this manner, an implicit declaration is hidden + -- within the entire scope of the other declaration + -- (regardless of which declaration occurs first); + -- the implicit declaration is visible neither by + -- selected nor directly. + Set_Visible_Flag (Current_Decl, False); + end if; end; else -- GHDL: hide directly visible declaration declared in |