3 package body Protected_Func
with SPARK_Mode
is
4 protected body Prot_Obj
is
5 function Prot_Func
return Integer is
7 Comp
:= Comp
+ 1; -- { dg-error "protected function cannot modify its protected object" }
8 Part_Of_Constit
:= Part_Of_Constit
+ 1; -- { dg-error "protected function cannot modify its protected object" }
10 return Comp
+ Part_Of_Constit
;