aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-03-12 19:06:32 +0100
committerTristan Gingold <tgingold@free.fr>2019-03-14 07:14:44 +0100
commit145aa829f2b9166039442638e078f8aac5940ac6 (patch)
tree4642a4fc6f7547356a3e28cab22189770a85ee07 /src
parent4072f59cac54cf35d83d7bf8a1ca26eeeb25831a (diff)
downloadghdl-145aa829f2b9166039442638e078f8aac5940ac6.tar.gz
ghdl-145aa829f2b9166039442638e078f8aac5940ac6.tar.bz2
ghdl-145aa829f2b9166039442638e078f8aac5940ac6.zip
vhdl: error when a secondary unit is used for a configuration.
Fix #776
Diffstat (limited to 'src')
-rw-r--r--src/vhdl/configuration.adb10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/vhdl/configuration.adb b/src/vhdl/configuration.adb
index eb6db5667..f0a04897d 100644
--- a/src/vhdl/configuration.adb
+++ b/src/vhdl/configuration.adb
@@ -660,10 +660,16 @@ package body Configuration is
Set_Default_Configuration_Declaration (Lib_Unit, Top);
pragma Assert (Is_Valid (Top));
when Iir_Kind_Configuration_Declaration =>
+ if Secondary_Id /= Null_Identifier then
+ Error_Msg_Elab
+ ("no secondary unit allowed after configuration %i",
+ +Primary_Id);
+ return Null_Iir;
+ end if;
Top := Unit;
when others =>
- Error_Msg_Elab (Name_Table.Image (Primary_Id)
- & " is neither an entity nor a configuration");
+ Error_Msg_Elab ("%i is neither an entity nor a configuration",
+ +Primary_Id);
return Null_Iir;
end case;