[Ada] Minor reuse Is_Protected_Component
gcc/ada/ * lib-xref.adb (Generate_Reference): Fix reference to Analyze_Assignment. * sem_ch5.adb (Diagnose_Non_Variable_Lhs): Reuse existing utility function.
This commit is contained in:
parent
c1a69c9871
commit
3480505630
@ -819,7 +819,7 @@ package body Lib.Xref is
|
|||||||
end if;
|
end if;
|
||||||
|
|
||||||
-- For the left hand of an assignment case, we do nothing here.
|
-- For the left hand of an assignment case, we do nothing here.
|
||||||
-- The processing for Analyze_Assignment_Statement will set the
|
-- The processing for Analyze_Assignment will set the
|
||||||
-- Referenced_As_LHS flag.
|
-- Referenced_As_LHS flag.
|
||||||
|
|
||||||
else
|
else
|
||||||
|
@ -192,9 +192,7 @@ package body Sem_Ch5 is
|
|||||||
-- directly.
|
-- directly.
|
||||||
|
|
||||||
elsif (Is_Prival (Ent) and then Within_Function)
|
elsif (Is_Prival (Ent) and then Within_Function)
|
||||||
or else
|
or else Is_Protected_Component (Ent)
|
||||||
(Ekind (Ent) = E_Component
|
|
||||||
and then Is_Protected_Type (Scope (Ent)))
|
|
||||||
then
|
then
|
||||||
Error_Msg_N
|
Error_Msg_N
|
||||||
("protected function cannot modify protected object", N);
|
("protected function cannot modify protected object", N);
|
||||||
|
Loading…
Reference in New Issue
Block a user