summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTristan Gingold2016-01-03 22:05:09 +0100
committerTristan Gingold2016-01-03 22:07:23 +0100
commit80d043b5ae54466989cb9f42d842a43ff712702c (patch)
treea0f8d78beefef19277d4d8bdda6ce0e17893bce4 /src
parentf0ebc51e46d4d2eb8c6537307301eed85c071db3 (diff)
downloadghdl-80d043b5ae54466989cb9f42d842a43ff712702c.tar.gz
ghdl-80d043b5ae54466989cb9f42d842a43ff712702c.tar.bz2
ghdl-80d043b5ae54466989cb9f42d842a43ff712702c.zip
Forbid protected types in elements or designated types.
Diffstat (limited to 'src')
-rw-r--r--src/vhdl/sem_types.adb10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/vhdl/sem_types.adb b/src/vhdl/sem_types.adb
index 8cf5265..e626fb1 100644
--- a/src/vhdl/sem_types.adb
+++ b/src/vhdl/sem_types.adb
@@ -480,7 +480,10 @@ package body Sem_Types is
case Get_Kind (El_Type) is
when Iir_Kind_File_Type_Definition =>
Error_Msg_Sem
- ("element of file type is not allowed in a composite type", Loc);
+ ("file type element not allowed in a composite type", Loc);
+ when Iir_Kind_Protected_Type_Declaration =>
+ Error_Msg_Sem
+ ("protected type element not allowed in a composite type", Loc);
when others =>
null;
end case;
@@ -1074,6 +1077,11 @@ package body Sem_Types is
-- LRM 3.3
-- The designated type must not be a file type.
Error_Msg_Sem ("designated type must not be a file type", Def);
+ when Iir_Kind_Protected_Type_Declaration =>
+ -- LRM02 3.3
+ -- [..] or a protected type.
+ Error_Msg_Sem
+ ("designated type must not be a protected type", Def);
when others =>
null;
end case;