===================================================================
@@ -7837,14 +7837,16 @@ package body Sem_Attr is
if Ekind_In (Btyp, E_Access_Subprogram_Type,
E_Anonymous_Access_Subprogram_Type,
+ E_Access_Protected_Subprogram_Type,
E_Anonymous_Access_Protected_Subprogram_Type)
then
-- Deal with convention mismatch
- if Convention (Btyp) /= Convention (Entity (P)) then
+ if Convention (Designated_Type (Btyp)) /=
+ Convention (Entity (P))
+ then
Error_Msg_FE
("subprogram & has wrong convention", P, Entity (P));
-
Error_Msg_FE
("\does not match convention of access type &",
P, Btyp);
===================================================================
@@ -2929,6 +2929,14 @@ package body Sem_Ch6 is
Write_Eol;
end if;
+ if Is_Protected_Type (Current_Scope) then
+
+ -- Indicate that this is a protected operation, because it may be
+ -- used in subsequent declarations within the protected type.
+
+ Set_Convention (Designator, Convention_Protected);
+ end if;
+
List_Inherited_Pre_Post_Aspects (Designator);
Analyze_Aspect_Specifications (N, Designator, Aspect_Specifications (N));
end Analyze_Subprogram_Declaration;