ada: Constant_Indexing used when context requires a variable
commitab0efa304ffd7139105139c90de63ca0651ef274
authorSteve Baird <baird@adacore.com>
Tue, 14 Nov 2023 21:33:31 +0000 (14 13:33 -0800)
committerMarc Poulhiès <poulhies@adacore.com>
Thu, 30 Nov 2023 10:12:46 +0000 (30 11:12 +0100)
tree7b22a6fd85c116e8d7c4066af88815f2744de270
parentf2c52c0dfde581461959b0e2b423ad106aadf179
ada: Constant_Indexing used when context requires a variable

In the case of a call with a formal parameter of mode other than "IN"
where the corresponding actual parameter is a generalized indexing
and the indexable container has both Constant_Indexing and Variable_Indexing
aspects specified, the generalized indexing must be interpreted as a
variable indexing, not as a constant indexing. In some cases involving a
call to a prefixed view of a subprogram, this was not handled correctly.
This error results in spurious compile-time error messages saying that
the actual parameter in the call "must be a variable".

gcc/ada/

* sem_ch4.adb (Constant_Indexing_OK): As a temporary stopgap,
return False in the case of an unanalyzed prefixed-view call.
gcc/ada/sem_ch4.adb