From 2d14501c4714ef2b4ab848d52d22a1c700804197 Mon Sep 17 00:00:00 2001 From: Samuel Tardieu Date: Wed, 13 Aug 2008 10:57:43 +0000 Subject: 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 --- gcc/ada/sem_util.ads | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gcc/ada/sem_util.ads') 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. -- cgit v1.1