[Ada] Fix resolution of Declare_Expressions involving transient scopes
authorEd Schonberg <schonberg@adacore.com>
Mon, 30 Aug 2021 21:41:29 +0000 (17:41 -0400)
committerPierre-Marie de Rodat <derodat@adacore.com>
Mon, 4 Oct 2021 08:45:08 +0000 (08:45 +0000)
commitf729943cf65ec9d475acccc5d04d7752680e19a3
treee4a0af27aeed2223d437c72897f130ab6b01be66
parent8e1e74a162c751014b43d609207aaf75ed4dd428
[Ada] Fix resolution of Declare_Expressions involving transient scopes

gcc/ada/

* sem_res.adb (Resolve_Declare_Expression): Use tree traversals
to perform name capture of local entities in the expression of
the construct.
* exp_util.adb (Possible_Side_Effects_In_SPARK): Do not apply to
the prefix of an attribute reference Reduce when that prefix is
an aggregate, because it will be expanded into a loop, and has
no identifiable type.
gcc/ada/exp_util.adb
gcc/ada/sem_res.adb