aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_util.ads
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2008-08-13 10:57:43 +0000
committerSamuel Tardieu <sam@gcc.gnu.org>2008-08-13 10:57:43 +0000
commit2d14501c4714ef2b4ab848d52d22a1c700804197 (patch)
treec41ab659ced89553be1789d5dab8a19dc9465c2f /gcc/ada/sem_util.ads
parent85790e667775932ee784b9c1636dafcc66ac32d3 (diff)
downloadgcc-2d14501c4714ef2b4ab848d52d22a1c700804197.zip
gcc-2d14501c4714ef2b4ab848d52d22a1c700804197.tar.gz
gcc-2d14501c4714ef2b4ab848d52d22a1c700804197.tar.bz2
re PR ada/36777 (Protected type cannot have access taken from its body.)
gcc/ada/ PR ada/36777 * sem_util.ads, sem_util.adb (Is_Protected_Self_Reference): New. * sem_attr.adb (Check_Type): The current instance of a protected object is not a type name. (Analyze_Access_Attribute): Accept instances of protected objects. (Analyze_Attribute, Attribute_Address clause): Ditto. * exp_attr.adb (Expand_N_Attribute_Reference): Rewrite the prefix as being the current instance if needed. gcc/testsuite/ PR ada/36777 * gnat.dg/protected_self_ref1.adb, gnat.dg/protected_self_ref2.adb: New. From-SVN: r139051
Diffstat (limited to 'gcc/ada/sem_util.ads')
-rw-r--r--gcc/ada/sem_util.ads4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/ada/sem_util.ads b/gcc/ada/sem_util.ads
index 00c1e38..a8f7fc8 100644
--- a/gcc/ada/sem_util.ads
+++ b/gcc/ada/sem_util.ads
@@ -726,6 +726,10 @@ package Sem_Util is
-- persistent. A private type is potentially persistent if the full type
-- is potentially persistent.
+ function Is_Protected_Self_Reference (N : Node_Id) return Boolean;
+ -- Return True if node N denotes a protected type name which represents
+ -- the current instance of a protected object according to RM 9.4(21/2).
+
function Is_RCI_Pkg_Spec_Or_Body (Cunit : Node_Id) return Boolean;
-- Return True if a compilation unit is the specification or the
-- body of a remote call interface package.