[Ada] Legality of protected subp. implementing interface operations
This patch refines the predicate that implements rule in RM 9.4 (11.9/2)
Compiling b94.ads must yield:
b94.ads:11:17: illegal overriding of subprogram inherited from interface
b94.ads:11:17: first formal of "N" declared at line 8 must be of mode
"out", "in out" or access-to-variable
----
package B94 is
type Prot2_Int is protected interface;
procedure J (PI : in Prot2_Int; N : in Integer) is null;
procedure K (PI : in out Prot2_Int; N : in Integer) is null;
procedure L (PI : out Prot2_Int; N : in Integer) is null;
procedure M (PI : access Prot2_Int; N : in Integer) is null;
procedure N (PI : access constant Prot2_Int; N : in Integer) is null;
protected type Protected_2 is new Prot2_Int with
procedure N (N : in Integer); -- ERROR: {7;1}
end Protected_2;
end B94;
2019-08-19 Ed Schonberg <schonberg@adacore.com>
gcc/ada/
* sem_ch6.adb (Check_Synchronized_Overriding): Complete
predicate that applies legality check in 9.4 (11.9/2): if an
inherited subprogram is implemented by a protected procedure or
entry, its first paarameter must be out, in_out or
access_to_varible.
From-SVN: r274655