From 0a33c7864ef98e93f316036314f7a081190f4352 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sun, 25 Sep 2022 06:53:12 +0200 Subject: vhdl-sem_decls: handle protected type subtypes Fix #2196 --- src/vhdl/vhdl-sem_decls.adb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/vhdl/vhdl-sem_decls.adb b/src/vhdl/vhdl-sem_decls.adb index 55cc4b793..a9c686707 100644 --- a/src/vhdl/vhdl-sem_decls.adb +++ b/src/vhdl/vhdl-sem_decls.adb @@ -835,10 +835,13 @@ package body Vhdl.Sem_Decls is return; end if; - if not Is_Anonymous_Type_Definition (Def) then + if not Is_Anonymous_Type_Definition (Def) + and then Get_Kind (Def) /= Iir_Kind_Protected_Type_Declaration + then -- There is no added constraints and therefore the subtype -- declaration is in fact an alias of the type. Create a copy so -- that it has its own type declarator. + -- (Except for protected types). Def := Copy_Subtype_Indication (Def); Location_Copy (Def, Decl); Set_Subtype_Type_Mark (Def, Ind); -- cgit v1.2.3