diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2020-11-14 23:26:05 +0100 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2020-11-30 09:16:20 -0500 |
commit | 348050563099e7b73e37d28d10beac3a7dec1a86 (patch) | |
tree | ca90a4afe04b598c5698bd9967234a7a73f3be3d /gcc | |
parent | c1a69c98717d9c63ffde67746c56243d530c9109 (diff) | |
download | gcc-348050563099e7b73e37d28d10beac3a7dec1a86.zip gcc-348050563099e7b73e37d28d10beac3a7dec1a86.tar.gz gcc-348050563099e7b73e37d28d10beac3a7dec1a86.tar.bz2 |
[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.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/lib-xref.adb | 2 | ||||
-rw-r--r-- | 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 64b9683..0869906 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 2afe18b..df412bd 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); |