aboutsummaryrefslogtreecommitdiffstats
path: root/src/vhdl/vhdl-sem_decls.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2022-09-25 06:53:12 +0200
committerTristan Gingold <tgingold@free.fr>2022-09-25 11:43:31 +0200
commit0a33c7864ef98e93f316036314f7a081190f4352 (patch)
tree35d8cd9b7d9e5866a49f421ccf5be01bf653aba1 /src/vhdl/vhdl-sem_decls.adb
parent00e3aafd8df24a670e583e3429b6fdeb509735a4 (diff)
downloadghdl-0a33c7864ef98e93f316036314f7a081190f4352.tar.gz
ghdl-0a33c7864ef98e93f316036314f7a081190f4352.tar.bz2
ghdl-0a33c7864ef98e93f316036314f7a081190f4352.zip
vhdl-sem_decls: handle protected type subtypes
Fix #2196
Diffstat (limited to 'src/vhdl/vhdl-sem_decls.adb')
-rw-r--r--src/vhdl/vhdl-sem_decls.adb5
1 files changed, 4 insertions, 1 deletions
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);