From: Piotr Trojanek Date: Sat, 14 Nov 2020 22:26:05 +0000 (+0100) Subject: [Ada] Minor reuse Is_Protected_Component X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=348050563099e7b73e37d28d10beac3a7dec1a86;p=gcc.git [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. --- diff --git a/gcc/ada/lib-xref.adb b/gcc/ada/lib-xref.adb index 64b9683a784..08699060aa3 100644 --- a/gcc/ada/lib-xref.adb +++ b/gcc/ada/lib-xref.adb @@ -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 diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb index 2afe18b122f..df412bd4714 100644 --- a/gcc/ada/sem_ch5.adb +++ b/gcc/ada/sem_ch5.adb @@ -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);