aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl
diff options
context:
space:
mode:
Diffstat (limited to 'src/vhdl')
-rw-r--r--src/vhdl/sem_names.adb10
-rw-r--r--src/vhdl/sem_scopes.ads10
2 files changed, 19 insertions, 1 deletions
diff --git a/src/vhdl/sem_names.adb b/src/vhdl/sem_names.adb
index d8d7dea6e..141563292 100644
--- a/src/vhdl/sem_names.adb
+++ b/src/vhdl/sem_names.adb
@@ -1830,7 +1830,15 @@ package body Sem_Names is
if not Valid_Interpretation (Interpretation) then
-- Unknown name.
if not Soft then
- Error_Msg_Sem (+Name, "no declaration for %i", +Name);
+ Interpretation := Get_Interpretation_Raw (Id);
+ if Valid_Interpretation (Interpretation)
+ and then Is_Conflict_Declaration (Interpretation)
+ then
+ Error_Msg_Sem
+ (+Name, "no declaration for %i (due to conflicts)", +Name);
+ else
+ Error_Msg_Sem (+Name, "no declaration for %i", +Name);
+ end if;
end if;
Res := Error_Mark;
elsif not Valid_Interpretation (Get_Next_Interpretation (Interpretation))
diff --git a/src/vhdl/sem_scopes.ads b/src/vhdl/sem_scopes.ads
index 6942c5430..3503d4fb6 100644
--- a/src/vhdl/sem_scopes.ads
+++ b/src/vhdl/sem_scopes.ads
@@ -105,6 +105,16 @@ package Sem_Scopes is
return Boolean;
pragma Inline (Is_In_Current_Declarative_Region);
+ -- Return the raw interpretation of ID. To be used only in case of
+ -- invalid interpretation to clarify the issue: this may be due to
+ -- conflicting declarations.
+ function Get_Interpretation_Raw (Id : Name_Id)
+ return Name_Interpretation_Type;
+
+ -- Return True iff NI is a conflicting declaration.
+ function Is_Conflict_Declaration (Ni : Name_Interpretation_Type)
+ return Boolean;
+
-- Push and pop all interpretations.
-- This can be used to suspend name interpretation, in case of recursive
-- semantics.