diff options
author | Piotr Trojanek <trojanek@adacore.com> | 2024-01-16 12:55:24 +0100 |
---|---|---|
committer | Marc Poulhiès <poulhies@adacore.com> | 2024-05-07 09:55:56 +0200 |
commit | e8bcc47f25e59683194446c45a68442e1702259b (patch) | |
tree | f472ea422f9f20f7efa2bab91100ce77d7418d7a /gcc/ada/lib.ads | |
parent | 5c8f6ee3663fc77834d1eb5f2d16e7d3ceb5d8cd (diff) | |
download | gcc-e8bcc47f25e59683194446c45a68442e1702259b.zip gcc-e8bcc47f25e59683194446c45a68442e1702259b.tar.gz gcc-e8bcc47f25e59683194446c45a68442e1702259b.tar.bz2 |
ada: Fix detection of components with per-object constraints
Routine Contains_POC (where POC means "per-object constraint") was
failing to detect expressions of the form "Current_Type'Access", because
it was comparing prefix (typically an N_Identifier) with a scope
(typically an N_Definining_Entity). This was harmless, because these
expressions are detected anyway in Analyze_Access_Attribute, together
with uses of 'Unconstrained_Access and 'Unchecked_Access.
Also, this routine was failing to detect the use of discriminants in
array types with constrained subtype indication, e.g.:
type T (D : Integer) is record
C : array (Integer range 1 .. D);
end record;
It is simpler to just reuse Has_Discriminant_Dependent_Constraint and
leave detection of access attributes to Analyze_Access_Attribute.
gcc/ada/
* sem_attr.adb (Analyze_Access_Attribute): Prevent search from
going too far.
* sem_ch3.adb (Analyze_Component_Declaration): Remove
Contains_POC; reuse Has_Discriminant_Dependent_Constraint.
Diffstat (limited to 'gcc/ada/lib.ads')
0 files changed, 0 insertions, 0 deletions