[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;
|
||||
|
||||
-- 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.
|
||||
|
||||
else
|
||||
|
@ -192,9 +192,7 @@ package body Sem_Ch5 is
|
||||
-- directly.
|
||||
|
||||
elsif (Is_Prival (Ent) and then Within_Function)
|
||||
or else
|
||||
(Ekind (Ent) = E_Component
|
||||
and then Is_Protected_Type (Scope (Ent)))
|
||||
or else Is_Protected_Component (Ent)
|
||||
then
|
||||
Error_Msg_N
|
||||
("protected function cannot modify protected object", N);
|
||||
|
Loading…
Reference in New Issue
Block a user