exp_attr.adb (Enclosing_Object): New function local to handling of access attributes...
authorGary Dismukes <dismukes@adacore.com>
Thu, 31 Jul 2008 11:04:10 +0000 (13:04 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Thu, 31 Jul 2008 11:04:10 +0000 (13:04 +0200)
commit01aef5ad76b8314af7406d515aa36e9e1eefa1b6
treea7da433816d4b3f46e8dfc4ed89205d226a52326
parent1d06f67ee225537cf9984b384dbe116830730705
exp_attr.adb (Enclosing_Object): New function local to handling of access attributes...

2008-07-31  Gary Dismukes  <dismukes@adacore.com>

* exp_attr.adb (Enclosing_Object): New function local to handling of
access attributes,
for retrieving the innermost enclosing object prefix of a compound name.
(Expand_N_Attribute_Reference, N_Attribute_Access): In the case where an
Access attribute has a prefix that is a dereference of an access
parameter (or the prefix is a subcomponent selected from such a
dereference), apply an accessibility check to the access parameter.
Replaces code that rewrote the prefix as a type conversion (and that
didn't handle subcomponent cases).
Also, this is now only applied in the case of 'Access.

* exp_ch6.adb (Expand_Call): Add handling for the case of an access
discriminant passed as an actual to an access formal, passing the
Object_Access_Level of the object containing the access discriminant.

From-SVN: r138388
gcc/ada/exp_attr.adb
gcc/ada/exp_ch6.adb