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>
* 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
Empty.
......
......@@ -66,7 +66,7 @@ with Sem_Type;
with Set_Targ;
with Sinfo; use Sinfo;
with Sinput.L; use Sinput.L;
with Snames;
with Snames; use Snames;
with Sprint; use Sprint;
with Stringt;
with Stylesw; use Stylesw;
......@@ -272,9 +272,13 @@ procedure Gnat1drv is
Restrict.Restrictions.Set (Max_Asynchronous_Select_Nesting) := True;
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
-- implicitly by CodePeer.
......
......@@ -1016,9 +1016,13 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
Count : Count_Type := 1)
is
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
-- 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
-- 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
-- initialization, so insert the specified number of possibly
-- initialized elements at the given position.
Insert (Container, Before, New_Item, Position, Count);
Insert (Container, Before, Default_Initialized_Item, Position, Count);
pragma Warnings (On);
end Insert;
......
......@@ -578,8 +578,9 @@ package body Ada.Containers.Bounded_Hashed_Maps is
-----------------
procedure Assign_Key (Node : in out Node_Type) is
New_Item : Element_Type;
pragma Unmodified (New_Item);
pragma Warnings (Off);
Default_Initialized_Item : Element_Type;
pragma Unmodified (Default_Initialized_Item);
-- Default-initialized element (ok to reference, see below)
begin
......@@ -591,7 +592,8 @@ package body Ada.Containers.Bounded_Hashed_Maps is
-- default initialization, so insert a possibly initialized element
-- under the given key.
Node.Element := New_Item;
Node.Element := Default_Initialized_Item;
pragma Warnings (On);
end Assign_Key;
--------------
......
......@@ -1581,8 +1581,9 @@ package body Ada.Containers.Bounded_Multiway_Trees is
First : Count_Type;
Last : Count_Type;
New_Item : Element_Type;
pragma Unmodified (New_Item);
pragma Warnings (Off);
Default_Initialized_Item : Element_Type;
pragma Unmodified (Default_Initialized_Item);
-- OK to reference, see below
begin
......@@ -1629,12 +1630,13 @@ package body Ada.Containers.Bounded_Multiway_Trees is
-- initialization, so insert the specified number of possibly
-- initialized elements at the given position.
Allocate_Node (Container, New_Item, First);
Allocate_Node (Container, Default_Initialized_Item, First);
Nodes (First).Parent := Parent.Node;
Last := First;
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).Prev := Last;
......@@ -1651,6 +1653,7 @@ package body Ada.Containers.Bounded_Multiway_Trees is
Container.Count := Container.Count + Count;
Position := Cursor'(Parent.Container, First);
pragma Warnings (On);
end Insert_Child;
-------------------------
......
......@@ -851,8 +851,9 @@ package body Ada.Containers.Bounded_Ordered_Maps is
------------
procedure Assign (Node : in out Node_Type) is
New_Item : Element_Type;
pragma Unmodified (New_Item);
pragma Warnings (Off);
Default_Initialized_Item : Element_Type;
pragma Unmodified (Default_Initialized_Item);
-- Default-initialized element (ok to reference, see below)
begin
......@@ -863,7 +864,8 @@ package body Ada.Containers.Bounded_Ordered_Maps is
-- with such a scalar component or with defaulted components, so insert
-- possibly initialized elements at the given position.
Node.Element := New_Item;
Node.Element := Default_Initialized_Item;
pragma Warnings (On);
end Assign;
--------------
......
......@@ -2676,14 +2676,11 @@ package body Sem_Ch3 is
and then not Is_Child_Unit (Current_Scope)
and then No (Generic_Parent (Parent (L)))
then
-- This is needed in all cases to catch visibility errors in
-- aspect expressions, but several large user tests are now
-- rejected. Pending notification we restrict this call to
-- ASIS mode.
-- ARM rule 13.1.1(11/3): usage names in aspect definitions are
-- resolved at the end of the immediately enclosing declaration
-- list (AI05-0183-1).
if ASIS_Mode then
Resolve_Aspects;
end if;
elsif L /= Visible_Declarations (Parent (L))
or else No (Private_Declarations (Parent (L)))
......
......@@ -2798,6 +2798,7 @@ package body Sem_Warn is
-- Note: use of OR instead of OR ELSE here is deliberate, we want
-- to mess with Unmodified flags on both body and spec entities.
-- Has_Unmodified has side effects!
return Has_Unmodified (E)
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