summaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch4.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2016-04-20 10:43:03 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2016-04-20 10:43:03 +0000
commit3fd12262826813f8d05051110dc981e646dcbe6d (patch)
treec3b71f0239a85b252e0c0c376e7a97d11dafa6a9 /gcc/ada/sem_ch4.adb
parent527674cb82c1df36e2c9d9b0058ab924be9d8652 (diff)
downloadgcc-3fd12262826813f8d05051110dc981e646dcbe6d.tar.gz
2016-04-20 Ed Schonberg <schonberg@adacore.com>
* sem_ch4.adb (Analyze_Selected_Component): A reference to the current instance of a task type is legal if the prefix is an expression of that task type and the selector is an entry or entry family. 2016-04-20 Arnaud Charlet <charlet@adacore.com> * a-cfdlli.ads (List): Type is no longer tagged, not needed. Move varsize field at the end for efficiency. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@235261 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_ch4.adb')
-rw-r--r--gcc/ada/sem_ch4.adb24
1 files changed, 17 insertions, 7 deletions
diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb
index 80e94319adb..6226c8c137a 100644
--- a/gcc/ada/sem_ch4.adb
+++ b/gcc/ada/sem_ch4.adb
@@ -4109,7 +4109,7 @@ package body Sem_Ch4 is
-- indexed component rather than a function call.
function Has_Dereference (Nod : Node_Id) return Boolean;
- -- Check whether prefix includes a dereference at any level
+ -- Check whether prefix includes a dereference at any level.
--------------------------------
-- Find_Component_In_Instance --
@@ -4689,17 +4689,27 @@ package body Sem_Ch4 is
-- reach an internal entity of another synchronized object).
-- This is legal if prefix is an access to such type and there is
-- a dereference, or is a component with a dereferenced prefix.
+ -- It is also legal if the prefix is a component of a task type,
+ -- and the selector is one of the task operations.
if In_Scope
and then not Is_Entity_Name (Name)
and then not Has_Dereference (Name)
then
- Error_Msg_NE
- ("invalid reference to internal operation of some object of "
- & "type &", N, Type_To_Use);
- Set_Entity (Sel, Any_Id);
- Set_Etype (Sel, Any_Type);
- return;
+ if Is_Task_Type (Prefix_Type)
+ and then Present (Entity (Sel))
+ and then Ekind_In (Entity (Sel), E_Entry, E_Entry_Family)
+ then
+ null;
+
+ else
+ Error_Msg_NE
+ ("invalid reference to internal operation of some object of "
+ & "type &", N, Type_To_Use);
+ Set_Entity (Sel, Any_Id);
+ Set_Etype (Sel, Any_Type);
+ return;
+ end if;
end if;
-- If there is no visible entity with the given name or none of the