[Ada] Incorrect Dynamic_Predicate results for static arguments
authorSteve Baird <baird@adacore.com>
Mon, 4 Oct 2021 22:33:18 +0000 (15:33 -0700)
committerPierre-Marie de Rodat <derodat@adacore.com>
Mon, 11 Oct 2021 13:38:12 +0000 (13:38 +0000)
commit2ad5d5e3d5d40f220df7239b54d5017259dc4d1d
treec5c2def98d6a5e0dd9b05f762ce35ef657f0b791
parent26a7b2ada5f9be63a99ca3eca2a66168c8b2b26f
[Ada] Incorrect Dynamic_Predicate results for static arguments

gcc/ada/

* exp_ch6.adb (Can_Fold_Predicate_Call): Do not attempt folding
if there is more than one predicate involved. Recall that
predicate aspect specification are additive, not overriding, and
that there are three different predicate
aspects (Dynamic_Predicate, Static_Predicate, and the
GNAT-defined Predicate aspect). These various ways of
introducing multiple predicates are all checked for.  A new
nested function, Augments_Other_Dynamic_Predicate, is
introduced.
* sem_ch4.adb
(Analyze_Indexed_Component_Form.Process_Function_Call): When
determining whether a name like "X (Some_Discrete_Type)" might
be interpreted as a slice, the answer should be "no" if the
type/subtype name denotes the current instance of type/subtype.
gcc/ada/exp_ch6.adb
gcc/ada/sem_ch4.adb