[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:
Piotr Trojanek 2020-11-14 23:26:05 +01:00 committed by Pierre-Marie de Rodat
parent c1a69c9871
commit 3480505630
2 changed files with 2 additions and 4 deletions

View File

@ -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

View File

@ -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);