]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Evaluate static expressions in Range attributes
authorViljar Indus <indus@adacore.com>
Wed, 21 Jun 2023 13:22:37 +0000 (16:22 +0300)
committerMarc Poulhiès <poulhies@adacore.com>
Thu, 6 Jul 2023 11:36:10 +0000 (13:36 +0200)
commit15e2d19ff46527d56407eaea64161943efc3e2b7
tree86718cc3ace5e2c76197a0448a4bcd8ffd8c28ce
parentd4fea89d289d45aa6811b9e1fa6d40ba9f28dd60
ada: Evaluate static expressions in Range attributes

Gigi assumes that the value of range expressions is an integer literal.
Force evaluation of such expressions since static non-literal expressions
are not always evaluated to a literal form by gnat.

gcc/ada/

* sem_attr.adb (analyze_attribute.check_array_type): Replace valid
indexes with their staticly evaluated values.
gcc/ada/sem_attr.adb