aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/vhdl/errorout.ads3
-rw-r--r--src/vhdl/sem_scopes.adb15
2 files changed, 12 insertions, 6 deletions
diff --git a/src/vhdl/errorout.ads b/src/vhdl/errorout.ads
index 224f18cb9..ff7c54ada 100644
--- a/src/vhdl/errorout.ads
+++ b/src/vhdl/errorout.ads
@@ -103,6 +103,9 @@ package Errorout is
-- Declaration of a shared variable with a non-protected type.
Warnid_Shared,
+ -- A declaration hides a previous one.
+ Warnid_Hide,
+
-- Emit a warning when a declaration is never used.
-- FIXME: currently only subprograms are handled.
Warnid_Unused,
diff --git a/src/vhdl/sem_scopes.adb b/src/vhdl/sem_scopes.adb
index e0589dc3f..17e3847ed 100644
--- a/src/vhdl/sem_scopes.adb
+++ b/src/vhdl/sem_scopes.adb
@@ -913,12 +913,15 @@ package body Sem_Scopes is
end if;
end if;
- -- Homograph, not in the same scope.
- -- LRM §10.3:
- -- A declaration is said to be hidden within (part of) an inner
- -- declarative region if the inner region contains an homograph
- -- of this declaration; the outer declaration is the hidden
- -- within the immediate scope of the inner homograph.
+ -- Homograph, not in the same scope.
+ -- LRM §10.3:
+ -- A declaration is said to be hidden within (part of) an inner
+ -- declarative region if the inner region contains an homograph
+ -- of this declaration; the outer declaration is the hidden
+ -- within the immediate scope of the inner homograph.
+ Warning_Msg_Sem (Warnid_Hide, +Decl,
+ "declaration of %i hides %n", (+Decl, +Current_Decl));
+
Add_New_Interpretation (True);
end Add_Name;