Commit 0f8b3e5d by Arnaud Charlet

[multiple changes]

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.

From-SVN: r235261
parent 0c61772a
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.
2016-04-20 Vincent Celier <celier@adacore.com> 2016-04-20 Vincent Celier <celier@adacore.com>
* gnatcmd.adb: Do not invoke gprls when the invocation of "gnat * gnatcmd.adb: Do not invoke gprls when the invocation of "gnat
......
...@@ -353,12 +353,12 @@ private ...@@ -353,12 +353,12 @@ private
type Node_Array is array (Count_Type range <>) of Node_Type; type Node_Array is array (Count_Type range <>) of Node_Type;
function "=" (L, R : Node_Array) return Boolean is abstract; function "=" (L, R : Node_Array) return Boolean is abstract;
type List (Capacity : Count_Type) is tagged record type List (Capacity : Count_Type) is record
Nodes : Node_Array (1 .. Capacity) := (others => <>);
Free : Count_Type'Base := -1; Free : Count_Type'Base := -1;
Length : Count_Type := 0; Length : Count_Type := 0;
First : Count_Type := 0; First : Count_Type := 0;
Last : Count_Type := 0; Last : Count_Type := 0;
Nodes : Node_Array (1 .. Capacity) := (others => <>);
end record; end record;
type Cursor is record type Cursor is record
......
...@@ -4109,7 +4109,7 @@ package body Sem_Ch4 is ...@@ -4109,7 +4109,7 @@ package body Sem_Ch4 is
-- indexed component rather than a function call. -- indexed component rather than a function call.
function Has_Dereference (Nod : Node_Id) return Boolean; 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 -- -- Find_Component_In_Instance --
...@@ -4689,17 +4689,27 @@ package body Sem_Ch4 is ...@@ -4689,17 +4689,27 @@ package body Sem_Ch4 is
-- reach an internal entity of another synchronized object). -- reach an internal entity of another synchronized object).
-- This is legal if prefix is an access to such type and there is -- This is legal if prefix is an access to such type and there is
-- a dereference, or is a component with a dereferenced prefix. -- 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 if In_Scope
and then not Is_Entity_Name (Name) and then not Is_Entity_Name (Name)
and then not Has_Dereference (Name) and then not Has_Dereference (Name)
then then
Error_Msg_NE if Is_Task_Type (Prefix_Type)
("invalid reference to internal operation of some object of " and then Present (Entity (Sel))
& "type &", N, Type_To_Use); and then Ekind_In (Entity (Sel), E_Entry, E_Entry_Family)
Set_Entity (Sel, Any_Id); then
Set_Etype (Sel, Any_Type); null;
return;
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; end if;
-- If there is no visible entity with the given name or none of the -- If there is no visible entity with the given name or none of the
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment