From 348050563099e7b73e37d28d10beac3a7dec1a86 Mon Sep 17 00:00:00 2001 From: Piotr Trojanek Date: Sat, 14 Nov 2020 23:26:05 +0100 Subject: [PATCH] [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. --- gcc/ada/lib-xref.adb | 2 +- gcc/ada/sem_ch5.adb | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) 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); -- 2.30.2