diff options
author | Bob Duff <duff@adacore.com> | 2022-12-12 15:31:05 -0500 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2023-01-05 15:29:57 +0100 |
commit | 46924ad780665721a51306a646f7f601c359ba4c (patch) | |
tree | a4ea9c820d81bf9b1120dff93fc44d1655cd6d28 /gcc/ada/einfo.ads | |
parent | a24888388bab339cf8a8726ca67a0b4947a2d9ce (diff) | |
download | gcc-46924ad780665721a51306a646f7f601c359ba4c.zip gcc-46924ad780665721a51306a646f7f601c359ba4c.tar.gz gcc-46924ad780665721a51306a646f7f601c359ba4c.tar.bz2 |
ada: Fix incorrect warning about unreferenced packed arrays
This patch fixes a bug in which a reference to a renaming of a
component of a packed array was not counted as a reference,
and thus caused incorrect warnings about unreferenced objects.
gcc/ada/
* sem_ch5.adb (Analyze_Assignment): Fix the bug by checking
Original_Node. The renaming might be elsewhere, but the (original)
reference is right here.
* errout.adb: Remove pragma Unreferenced which was added because
of the above bug.
* einfo.ads: Misc cleanup.
* lib.adb: Likewise.
* lib.ads: Likewise.
Diffstat (limited to 'gcc/ada/einfo.ads')
-rw-r--r-- | gcc/ada/einfo.ads | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/ada/einfo.ads b/gcc/ada/einfo.ads index d71dcaf..94022e7 100644 --- a/gcc/ada/einfo.ads +++ b/gcc/ada/einfo.ads @@ -1865,7 +1865,7 @@ package Einfo is -- Has_Per_Object_Constraint -- Defined in E_Component entities. Set if the subtype of the component -- has a per object constraint. Per object constraints result from the --- following situations : +-- following situations: -- -- 1. N_Attribute_Reference - when the prefix is the enclosing type and -- the attribute is Access. @@ -4136,14 +4136,14 @@ package Einfo is -- set instead, or a similar appearance as an out parameter actual, in -- which case Referenced_As_Out_Parameter is set. --- Referenced_As_LHS : +-- Referenced_As_LHS -- Defined in all entities. This flag is set instead of Referenced if a -- simple variable that is not a renaming appears as the left side of an -- assignment. The reason we distinguish this kind of reference is that -- we have a separate warning for variables that are only assigned and -- never read. --- Referenced_As_Out_Parameter : +-- Referenced_As_Out_Parameter -- Defined in all entities. This flag is set instead of Referenced if a -- simple variable that is not a renaming appears as an actual for an out -- formal. The reason we distinguish this kind of reference is that |