From 145aa829f2b9166039442638e078f8aac5940ac6 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Tue, 12 Mar 2019 19:06:32 +0100 Subject: vhdl: error when a secondary unit is used for a configuration. Fix #776 --- src/vhdl/configuration.adb | 10 ++++++++-- 1 file 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; -- cgit v1.2.3