[Ada] Implement AI12-0032 fixes for 'Old attribute accessibility
authorSteve Baird <baird@adacore.com>
Thu, 23 Apr 2020 21:39:55 +0000 (14:39 -0700)
committerPierre-Marie de Rodat <derodat@adacore.com>
Thu, 18 Jun 2020 09:08:31 +0000 (05:08 -0400)
commit13175003d4aecbb1cb8f6e5707c22d318bd0f2a0
tree73031e221efce23558ffe69aa207f19cd44e4e82
parenta6c467131b0c07ab5d9b136148cae201de540109
[Ada] Implement AI12-0032 fixes for 'Old attribute accessibility

2020-06-18  Steve Baird  <baird@adacore.com>

gcc/ada/

* sem_util.adb (Object_Access_Level): Treat a 'Old attribute
reference like an aggregate in determining its static
accessibility level; after the evaluation of the relevant
post-condition, the implicitly declared constant associated with
an Old attribute reference ceases to exist. Similarly for
Loop_Entry attribute.
* exp_ch6.adb (Expand_Call_Helper): For an attribute reference
that is expanded into a reference to an implicitly declared
constant (e.g., a 'Old or 'Loop_Entry attribute), compute the
dynamic accessibility level of that constant by looking at the
declaration of the constant (as opposed to looking at the
attribute reference).
gcc/ada/exp_ch6.adb
gcc/ada/sem_util.adb