aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2021-07-28 22:09:45 +0200
committerTristan Gingold <tgingold@free.fr>2021-07-28 22:09:45 +0200
commit5d6232f08fb5597aa3833f69e52ecbb4be250071 (patch)
tree9af73777a8f85c6130d40bcd43c97a9090f865ac
parent51d8774fcd5ddd099aa2e28644711be083057751 (diff)
downloadghdl-5d6232f08fb5597aa3833f69e52ecbb4be250071.tar.gz
ghdl-5d6232f08fb5597aa3833f69e52ecbb4be250071.tar.bz2
ghdl-5d6232f08fb5597aa3833f69e52ecbb4be250071.zip
vhdl: move check on instantiation name from sem to parse.
Fix #1823
-rw-r--r--src/vhdl/vhdl-parse.adb3
-rw-r--r--src/vhdl/vhdl-sem_stmts.adb2
2 files changed, 4 insertions, 1 deletions
diff --git a/src/vhdl/vhdl-parse.adb b/src/vhdl/vhdl-parse.adb
index e958b8f09..726e8e1f4 100644
--- a/src/vhdl/vhdl-parse.adb
+++ b/src/vhdl/vhdl-parse.adb
@@ -9617,6 +9617,9 @@ package body Vhdl.Parse is
return Res;
when Tok_Generic | Tok_Port =>
-- or a component instantiation.
+ if Get_Kind (Target) not in Iir_Kinds_Denoting_Name then
+ Error_Msg_Parse (+Target, "component name expected");
+ end if;
return Parse_Component_Instantiation (Target);
when others =>
-- Catch PSL clock declaration. Within comments, this is the
diff --git a/src/vhdl/vhdl-sem_stmts.adb b/src/vhdl/vhdl-sem_stmts.adb
index 771a09c3a..8c16b6cea 100644
--- a/src/vhdl/vhdl-sem_stmts.adb
+++ b/src/vhdl/vhdl-sem_stmts.adb
@@ -1880,7 +1880,7 @@ package body Vhdl.Sem_Stmts is
-- Needs a denoting name
if Get_Kind (Inst) not in Iir_Kinds_Denoting_Name then
- Error_Msg_Sem (+Inst, "name for a component expected");
+ -- Error message already issued during parse.
return Null_Iir;
end if;