Commit b7051481 by Arnaud Charlet

[multiple changes]

2017-09-12  Bob Duff  <duff@adacore.com>

	* sem_warn.adb: Minor comment.

2017-09-12  Bob Duff  <duff@adacore.com>

	* libgnat/a-cbdlli.adb, libgnat/a-cbhama.adb,
	libgnat/a-cbmutr.adb, libgnat/a-cborma.adb: Rename New_Item to
	be Default_Initialized_Item, and apply pragma Unmodified to it,
	to suppress the warning.

2017-09-12  Eric Botcazou  <ebotcazou@adacore.com>

	* exp_aggr.adb (Aggr_Assignment_OK_For_Backend): Add early return
	for access types.

2017-09-12  Yannick Moy  <moy@adacore.com>

	* gnat1drv.adb (Adjust_Global_Switches): Consider Refined_Global
	together with Global when ignoring one in CodePeer mode.

2017-09-12  Javier Miranda  <miranda@adacore.com>

	* sem_ch3.adb (Analyze_Declarations): In nested
	package declarations that have a private part enable missing check
	of the RM rule 13.1.1(11/3): usage names in aspect definitions are
	resolved at the end of the immediately enclosing declaration list.

From-SVN: r252001
parent fb69239a
2017-09-12 Bob Duff <duff@adacore.com> 2017-09-12 Bob Duff <duff@adacore.com>
* sem_warn.adb: Minor comment.
2017-09-12 Bob Duff <duff@adacore.com>
* libgnat/a-cbdlli.adb, libgnat/a-cbhama.adb,
libgnat/a-cbmutr.adb, libgnat/a-cborma.adb: Rename New_Item to
be Default_Initialized_Item, and apply pragma Unmodified to it,
to suppress the warning.
2017-09-12 Eric Botcazou <ebotcazou@adacore.com>
* exp_aggr.adb (Aggr_Assignment_OK_For_Backend): Add early return
for access types.
2017-09-12 Yannick Moy <moy@adacore.com>
* gnat1drv.adb (Adjust_Global_Switches): Consider Refined_Global
together with Global when ignoring one in CodePeer mode.
2017-09-12 Javier Miranda <miranda@adacore.com>
* sem_ch3.adb (Analyze_Declarations): In nested
package declarations that have a private part enable missing check
of the RM rule 13.1.1(11/3): usage names in aspect definitions are
resolved at the end of the immediately enclosing declaration list.
2017-09-12 Bob Duff <duff@adacore.com>
* sem_ch6.adb (Analyze_Expression_Function): Initialize Def_Id to * sem_ch6.adb (Analyze_Expression_Function): Initialize Def_Id to
Empty. Empty.
......
...@@ -66,7 +66,7 @@ with Sem_Type; ...@@ -66,7 +66,7 @@ with Sem_Type;
with Set_Targ; with Set_Targ;
with Sinfo; use Sinfo; with Sinfo; use Sinfo;
with Sinput.L; use Sinput.L; with Sinput.L; use Sinput.L;
with Snames; with Snames; use Snames;
with Sprint; use Sprint; with Sprint; use Sprint;
with Stringt; with Stringt;
with Stylesw; use Stylesw; with Stylesw; use Stylesw;
...@@ -272,9 +272,13 @@ procedure Gnat1drv is ...@@ -272,9 +272,13 @@ procedure Gnat1drv is
Restrict.Restrictions.Set (Max_Asynchronous_Select_Nesting) := True; Restrict.Restrictions.Set (Max_Asynchronous_Select_Nesting) := True;
Restrict.Restrictions.Value (Max_Asynchronous_Select_Nesting) := 0; Restrict.Restrictions.Value (Max_Asynchronous_Select_Nesting) := 0;
-- Enable pragma Ignore_Pragma (Global) to support legacy code -- Enable pragma Ignore_Pragma (Global) to support legacy code. As a
-- consequence, Refined_Global pragma should be ignored as well, as
-- it is only allowed on a body when pragma Global is given for the
-- spec.
Set_Name_Table_Boolean3 (Name_Id'(Name_Find ("global")), True); Set_Name_Table_Boolean3 (Name_Global, True);
Set_Name_Table_Boolean3 (Name_Refined_Global, True);
-- Suppress division by zero checks since they are handled -- Suppress division by zero checks since they are handled
-- implicitly by CodePeer. -- implicitly by CodePeer.
......
...@@ -1016,9 +1016,13 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is ...@@ -1016,9 +1016,13 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
Count : Count_Type := 1) Count : Count_Type := 1)
is is
pragma Warnings (Off); pragma Warnings (Off);
New_Item : Element_Type; Default_Initialized_Item : Element_Type;
pragma Unmodified (Default_Initialized_Item);
-- OK to reference, see below. Note that we need to suppress both the -- OK to reference, see below. Note that we need to suppress both the
-- front end warning and the back end warning. -- front end warning and the back end warning. In addition, pragma
-- Unmodified is needed to suppress the warning ``actual type for
-- "Element_Type" should be fully initialized type'' on certain
-- instantiations.
begin begin
-- There is no explicit element provided, but in an instance the element -- There is no explicit element provided, but in an instance the element
...@@ -1027,7 +1031,7 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is ...@@ -1027,7 +1031,7 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
-- initialization, so insert the specified number of possibly -- initialization, so insert the specified number of possibly
-- initialized elements at the given position. -- initialized elements at the given position.
Insert (Container, Before, New_Item, Position, Count); Insert (Container, Before, Default_Initialized_Item, Position, Count);
pragma Warnings (On); pragma Warnings (On);
end Insert; end Insert;
......
...@@ -578,8 +578,9 @@ package body Ada.Containers.Bounded_Hashed_Maps is ...@@ -578,8 +578,9 @@ package body Ada.Containers.Bounded_Hashed_Maps is
----------------- -----------------
procedure Assign_Key (Node : in out Node_Type) is procedure Assign_Key (Node : in out Node_Type) is
New_Item : Element_Type; pragma Warnings (Off);
pragma Unmodified (New_Item); Default_Initialized_Item : Element_Type;
pragma Unmodified (Default_Initialized_Item);
-- Default-initialized element (ok to reference, see below) -- Default-initialized element (ok to reference, see below)
begin begin
...@@ -591,7 +592,8 @@ package body Ada.Containers.Bounded_Hashed_Maps is ...@@ -591,7 +592,8 @@ package body Ada.Containers.Bounded_Hashed_Maps is
-- default initialization, so insert a possibly initialized element -- default initialization, so insert a possibly initialized element
-- under the given key. -- under the given key.
Node.Element := New_Item; Node.Element := Default_Initialized_Item;
pragma Warnings (On);
end Assign_Key; end Assign_Key;
-------------- --------------
......
...@@ -1581,8 +1581,9 @@ package body Ada.Containers.Bounded_Multiway_Trees is ...@@ -1581,8 +1581,9 @@ package body Ada.Containers.Bounded_Multiway_Trees is
First : Count_Type; First : Count_Type;
Last : Count_Type; Last : Count_Type;
New_Item : Element_Type; pragma Warnings (Off);
pragma Unmodified (New_Item); Default_Initialized_Item : Element_Type;
pragma Unmodified (Default_Initialized_Item);
-- OK to reference, see below -- OK to reference, see below
begin begin
...@@ -1629,12 +1630,13 @@ package body Ada.Containers.Bounded_Multiway_Trees is ...@@ -1629,12 +1630,13 @@ package body Ada.Containers.Bounded_Multiway_Trees is
-- initialization, so insert the specified number of possibly -- initialization, so insert the specified number of possibly
-- initialized elements at the given position. -- initialized elements at the given position.
Allocate_Node (Container, New_Item, First); Allocate_Node (Container, Default_Initialized_Item, First);
Nodes (First).Parent := Parent.Node; Nodes (First).Parent := Parent.Node;
Last := First; Last := First;
for J in Count_Type'(2) .. Count loop for J in Count_Type'(2) .. Count loop
Allocate_Node (Container, New_Item, Nodes (Last).Next); Allocate_Node
(Container, Default_Initialized_Item, Nodes (Last).Next);
Nodes (Nodes (Last).Next).Parent := Parent.Node; Nodes (Nodes (Last).Next).Parent := Parent.Node;
Nodes (Nodes (Last).Next).Prev := Last; Nodes (Nodes (Last).Next).Prev := Last;
...@@ -1651,6 +1653,7 @@ package body Ada.Containers.Bounded_Multiway_Trees is ...@@ -1651,6 +1653,7 @@ package body Ada.Containers.Bounded_Multiway_Trees is
Container.Count := Container.Count + Count; Container.Count := Container.Count + Count;
Position := Cursor'(Parent.Container, First); Position := Cursor'(Parent.Container, First);
pragma Warnings (On);
end Insert_Child; end Insert_Child;
------------------------- -------------------------
......
...@@ -851,8 +851,9 @@ package body Ada.Containers.Bounded_Ordered_Maps is ...@@ -851,8 +851,9 @@ package body Ada.Containers.Bounded_Ordered_Maps is
------------ ------------
procedure Assign (Node : in out Node_Type) is procedure Assign (Node : in out Node_Type) is
New_Item : Element_Type; pragma Warnings (Off);
pragma Unmodified (New_Item); Default_Initialized_Item : Element_Type;
pragma Unmodified (Default_Initialized_Item);
-- Default-initialized element (ok to reference, see below) -- Default-initialized element (ok to reference, see below)
begin begin
...@@ -863,7 +864,8 @@ package body Ada.Containers.Bounded_Ordered_Maps is ...@@ -863,7 +864,8 @@ package body Ada.Containers.Bounded_Ordered_Maps is
-- with such a scalar component or with defaulted components, so insert -- with such a scalar component or with defaulted components, so insert
-- possibly initialized elements at the given position. -- possibly initialized elements at the given position.
Node.Element := New_Item; Node.Element := Default_Initialized_Item;
pragma Warnings (On);
end Assign; end Assign;
-------------- --------------
......
...@@ -2676,14 +2676,11 @@ package body Sem_Ch3 is ...@@ -2676,14 +2676,11 @@ package body Sem_Ch3 is
and then not Is_Child_Unit (Current_Scope) and then not Is_Child_Unit (Current_Scope)
and then No (Generic_Parent (Parent (L))) and then No (Generic_Parent (Parent (L)))
then then
-- This is needed in all cases to catch visibility errors in -- ARM rule 13.1.1(11/3): usage names in aspect definitions are
-- aspect expressions, but several large user tests are now -- resolved at the end of the immediately enclosing declaration
-- rejected. Pending notification we restrict this call to -- list (AI05-0183-1).
-- ASIS mode.
if ASIS_Mode then Resolve_Aspects;
Resolve_Aspects;
end if;
elsif L /= Visible_Declarations (Parent (L)) elsif L /= Visible_Declarations (Parent (L))
or else No (Private_Declarations (Parent (L))) or else No (Private_Declarations (Parent (L)))
......
...@@ -2798,6 +2798,7 @@ package body Sem_Warn is ...@@ -2798,6 +2798,7 @@ package body Sem_Warn is
-- Note: use of OR instead of OR ELSE here is deliberate, we want -- Note: use of OR instead of OR ELSE here is deliberate, we want
-- to mess with Unmodified flags on both body and spec entities. -- to mess with Unmodified flags on both body and spec entities.
-- Has_Unmodified has side effects!
return Has_Unmodified (E) return Has_Unmodified (E)
or or
......
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