Commit 8bfbd380 by Arnaud Charlet

[multiple changes]

2013-04-11  Arnaud Charlet  <charlet@adacore.com>

	* gnat1drv.adb: Minor code clean up.

2013-04-11  Arnaud Charlet  <charlet@adacore.com>

	* debug.adb, sem_ch13.adb (Analyze_Enumeration_Representation_Clause):
	Ignore enumeration rep clauses by default in CodePeer mode, unless
	-gnatd.I is specified.

2013-04-11  Ed Schonberg  <schonberg@adacore.com>

	* sem_util.adb (Safe_To_Capture_Value): If the node belongs to
	an expression that has been attached to the else_actions of an
	if-expression, the capture is not safe.

2013-04-11  Yannick Moy  <moy@adacore.com>

	* checks.adb (Apply_Type_Conversion_Checks): Put check mark on type
	conversion for arrays.

2013-04-11  Robert Dewar  <dewar@adacore.com>

	* a-cdlili.adb, a-cidlli.adb, a-cbdlli.adb: Minor reformatting.

2013-04-11  Johannes Kanig  <kanig@adacore.com>

	* adabkend.adb: Minor comment addition.

From-SVN: r197773
parent 256f3847
2013-04-11 Arnaud Charlet <charlet@adacore.com>
* gnat1drv.adb: Minor code clean up.
2013-04-11 Arnaud Charlet <charlet@adacore.com>
* debug.adb, sem_ch13.adb (Analyze_Enumeration_Representation_Clause):
Ignore enumeration rep clauses by default in CodePeer mode, unless
-gnatd.I is specified.
2013-04-11 Ed Schonberg <schonberg@adacore.com>
* sem_util.adb (Safe_To_Capture_Value): If the node belongs to
an expression that has been attached to the else_actions of an
if-expression, the capture is not safe.
2013-04-11 Yannick Moy <moy@adacore.com>
* checks.adb (Apply_Type_Conversion_Checks): Put check mark on type
conversion for arrays.
2013-04-11 Robert Dewar <dewar@adacore.com>
* a-cdlili.adb, a-cidlli.adb, a-cbdlli.adb: Minor reformatting.
2013-04-11 Johannes Kanig <kanig@adacore.com>
* adabkend.adb: Minor comment addition.
2013-04-11 Matthew Heaney <heaney@adacore.com>
* a-cdlili.adb, a-cidlli.adb, a-cbdlli.adb ("="): Increment
......
......@@ -156,6 +156,7 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
LR := LR - 1;
return Result;
exception
when others =>
BL := BL - 1;
......@@ -359,13 +360,12 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
begin
if Position.Container = null then
raise Constraint_Error with "Position cursor has no element";
end if;
if Position.Container /= Container'Unrestricted_Access then
elsif Position.Container /= Container'Unrestricted_Access then
raise Program_Error with
"Position cursor designates wrong container";
end if;
else
pragma Assert (Vet (Position), "bad cursor in Constant_Reference");
declare
......@@ -373,6 +373,7 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
begin
return (Element => N.Element'Access);
end;
end if;
end Constant_Reference;
--------------
......@@ -397,10 +398,8 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
begin
if Capacity = 0 then
C := Source.Length;
elsif Capacity >= Source.Length then
C := Capacity;
else
raise Capacity_Error with "Capacity value too small";
end if;
......@@ -508,7 +507,7 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
"attempt to tamper with cursors (list is busy)";
end if;
for I in 1 .. Count loop
for J in 1 .. Count loop
X := Container.First;
pragma Assert (N (N (X).Next).Prev = Container.First);
......@@ -547,7 +546,7 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
"attempt to tamper with cursors (list is busy)";
end if;
for I in 1 .. Count loop
for J in 1 .. Count loop
X := Container.Last;
pragma Assert (N (N (X).Prev).Next = Container.Last);
......@@ -569,11 +568,12 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
if Position.Node = 0 then
raise Constraint_Error with
"Position cursor has no element";
end if;
else
pragma Assert (Vet (Position), "bad cursor in Element");
return Position.Container.Nodes (Position.Node).Element;
end if;
end Element;
--------------
......@@ -585,7 +585,6 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
if Object.Container /= null then
declare
B : Natural renames Object.Container.all.Busy;
begin
B := B - 1;
end;
......@@ -648,6 +647,7 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
else
return Cursor'(Container'Unrestricted_Access, Result);
end if;
exception
when others =>
B := B - 1;
......@@ -664,9 +664,9 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
begin
if Container.First = 0 then
return No_Element;
end if;
else
return Cursor'(Container'Unrestricted_Access, Container.First);
end if;
end First;
function First (Object : Iterator) return Cursor is
......@@ -699,9 +699,9 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
begin
if Container.First = 0 then
raise Constraint_Error with "list is empty";
end if;
else
return Container.Nodes (Container.First).Element;
end if;
end First_Element;
----------
......@@ -858,6 +858,7 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
L := L - 1;
return Result;
exception
when others =>
B := B - 1;
......@@ -962,6 +963,7 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
SB := SB - 1;
SL := SL - 1;
exception
when others =>
TB := TB - 1;
......@@ -1076,6 +1078,7 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
B := B - 1;
L := L - 1;
exception
when others =>
B := B - 1;
......@@ -1287,7 +1290,6 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
Process (Cursor'(Container'Unrestricted_Access, Node));
Node := Container.Nodes (Node).Next;
end loop;
exception
when others =>
B := B - 1;
......@@ -1380,9 +1382,9 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
begin
if Container.Last = 0 then
return No_Element;
end if;
else
return Cursor'(Container'Unrestricted_Access, Container.Last);
end if;
end Last;
function Last (Object : Iterator) return Cursor is
......@@ -1415,9 +1417,9 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
begin
if Container.Last = 0 then
raise Constraint_Error with "list is empty";
end if;
else
return Container.Nodes (Container.Last).Element;
end if;
end Last_Element;
------------
......@@ -1536,13 +1538,12 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
declare
Nodes : Node_Array renames Position.Container.Nodes;
Node : constant Count_Type := Nodes (Position.Node).Next;
begin
if Node = 0 then
return No_Element;
end if;
else
return Cursor'(Position.Container, Node);
end if;
end;
end Next;
......@@ -1553,14 +1554,12 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
begin
if Position.Container = null then
return No_Element;
end if;
if Position.Container /= Object.Container then
elsif Position.Container /= Object.Container then
raise Program_Error with
"Position cursor of Next designates wrong list";
end if;
else
return Next (Position);
end if;
end Next;
-------------
......@@ -1599,9 +1598,9 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
begin
if Node = 0 then
return No_Element;
end if;
else
return Cursor'(Position.Container, Node);
end if;
end;
end Previous;
......@@ -1612,14 +1611,12 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
begin
if Position.Container = null then
return No_Element;
end if;
if Position.Container /= Object.Container then
elsif Position.Container /= Object.Container then
raise Program_Error with
"Position cursor of Previous designates wrong list";
end if;
else
return Previous (Position);
end if;
end Previous;
-------------------
......@@ -1680,20 +1677,19 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
if N < 0 then
raise Program_Error with "bad list length (corrupt stream)";
end if;
if N = 0 then
elsif N = 0 then
return;
end if;
if N > Item.Capacity then
elsif N > Item.Capacity then
raise Constraint_Error with "length exceeds capacity";
end if;
else
for Idx in 1 .. N loop
Allocate (Item, Stream, New_Node => X);
Insert_Internal (Item, Before => 0, New_Node => X);
end loop;
end if;
end Read;
procedure Read
......@@ -1731,13 +1727,12 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
begin
if Position.Container = null then
raise Constraint_Error with "Position cursor has no element";
end if;
if Position.Container /= Container'Unrestricted_Access then
elsif Position.Container /= Container'Unrestricted_Access then
raise Program_Error with
"Position cursor designates wrong container";
end if;
else
pragma Assert (Vet (Position), "bad cursor in function Reference");
declare
......@@ -1745,6 +1740,7 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
begin
return (Element => N.Element'Access);
end;
end if;
end Reference;
---------------------
......@@ -1759,21 +1755,20 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
begin
if Position.Container = null then
raise Constraint_Error with "Position cursor has no element";
end if;
if Position.Container /= Container'Unchecked_Access then
elsif Position.Container /= Container'Unchecked_Access then
raise Program_Error with
"Position cursor designates wrong container";
end if;
if Container.Lock > 0 then
elsif Container.Lock > 0 then
raise Program_Error with
"attempt to tamper with elements (list is locked)";
end if;
else
pragma Assert (Vet (Position), "bad cursor in Replace_Element");
Container.Nodes (Position.Node).Element := New_Item;
end if;
end Replace_Element;
----------------------
......@@ -1919,6 +1914,7 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
else
return Cursor'(Container'Unrestricted_Access, Result);
end if;
exception
when others =>
B := B - 1;
......@@ -1948,7 +1944,6 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
Process (Cursor'(Container'Unrestricted_Access, Node));
Node := Container.Nodes (Node).Prev;
end loop;
exception
when others =>
B := B - 1;
......@@ -1977,31 +1972,26 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
pragma Assert (Vet (Before), "bad cursor in Splice");
end if;
if Target'Address = Source'Address
or else Source.Length = 0
then
if Target'Address = Source'Address or else Source.Length = 0 then
return;
end if;
if Target.Length > Count_Type'Last - Source.Length then
elsif Target.Length > Count_Type'Last - Source.Length then
raise Constraint_Error with "new length exceeds maximum";
end if;
if Target.Length + Source.Length > Target.Capacity then
elsif Target.Length + Source.Length > Target.Capacity then
raise Capacity_Error with "new length exceeds target capacity";
end if;
if Target.Busy > 0 then
elsif Target.Busy > 0 then
raise Program_Error with
"attempt to tamper with cursors of Target (list is busy)";
end if;
if Source.Busy > 0 then
elsif Source.Busy > 0 then
raise Program_Error with
"attempt to tamper with cursors of Source (list is busy)";
end if;
else
Splice_Internal (Target, Before.Node, Source);
end if;
end Splice;
procedure Splice
......@@ -2583,7 +2573,7 @@ package body Ada.Containers.Bounded_Doubly_Linked_Lists is
pragma Assert (N (Position.Node).Prev /= 0);
-- ELiminate another possibility
-- Eliminate another possibility
if Position.Node = L.Last then
return True;
......
......@@ -135,6 +135,7 @@ package body Ada.Containers.Doubly_Linked_Lists is
LR := LR - 1;
return Result;
exception
when others =>
BL := BL - 1;
......@@ -404,6 +405,8 @@ package body Ada.Containers.Doubly_Linked_Lists is
Free (X);
end loop;
-- The following comment is unacceptable, more detail needed ???
Position := No_Element; -- Post-York behavior
end Delete;
......@@ -432,7 +435,7 @@ package body Ada.Containers.Doubly_Linked_Lists is
"attempt to tamper with cursors (list is busy)";
end if;
for I in 1 .. Count loop
for J in 1 .. Count loop
X := Container.First;
pragma Assert (X.Next.Prev = Container.First);
......@@ -470,7 +473,7 @@ package body Ada.Containers.Doubly_Linked_Lists is
"attempt to tamper with cursors (list is busy)";
end if;
for I in 1 .. Count loop
for J in 1 .. Count loop
X := Container.Last;
pragma Assert (X.Prev.Next = Container.Last);
......@@ -492,11 +495,11 @@ package body Ada.Containers.Doubly_Linked_Lists is
if Position.Node = null then
raise Constraint_Error with
"Position cursor has no element";
end if;
else
pragma Assert (Vet (Position), "bad cursor in Element");
return Position.Node.Element;
end if;
end Element;
--------------
......@@ -549,10 +552,10 @@ package body Ada.Containers.Doubly_Linked_Lists is
if Position.Container /= Container'Unrestricted_Access then
raise Program_Error with
"Position cursor designates wrong container";
end if;
else
pragma Assert (Vet (Position), "bad cursor in Find");
end if;
end if;
-- Per AI05-0022, the container implementation is required to detect
-- element tampering by a generic actual subprogram.
......@@ -572,9 +575,9 @@ package body Ada.Containers.Doubly_Linked_Lists is
if Node.Element = Item then
Result := Node;
exit;
end if;
else
Node := Node.Next;
end if;
end loop;
B := B - 1;
......@@ -585,6 +588,7 @@ package body Ada.Containers.Doubly_Linked_Lists is
else
return Cursor'(Container'Unrestricted_Access, Result);
end if;
exception
when others =>
B := B - 1;
......@@ -601,9 +605,9 @@ package body Ada.Containers.Doubly_Linked_Lists is
begin
if Container.First = null then
return No_Element;
end if;
else
return Cursor'(Container'Unrestricted_Access, Container.First);
end if;
end First;
function First (Object : Iterator) return Cursor is
......@@ -636,9 +640,9 @@ package body Ada.Containers.Doubly_Linked_Lists is
begin
if Container.First = null then
raise Constraint_Error with "list is empty";
end if;
else
return Container.First.Element;
end if;
end First_Element;
----------
......@@ -648,6 +652,7 @@ package body Ada.Containers.Doubly_Linked_Lists is
procedure Free (X : in out Node_Access) is
procedure Deallocate is
new Ada.Unchecked_Deallocation (Node_Type, Node_Access);
begin
-- While a node is in use, as an active link in a list, its Previous and
-- Next components must be null, or designate a different node; this is
......@@ -708,6 +713,7 @@ package body Ada.Containers.Doubly_Linked_Lists is
L := L - 1;
return Result;
exception
when others =>
B := B - 1;
......@@ -803,6 +809,7 @@ package body Ada.Containers.Doubly_Linked_Lists is
SB := SB - 1;
SL := SL - 1;
exception
when others =>
TB := TB - 1;
......@@ -830,9 +837,10 @@ package body Ada.Containers.Doubly_Linked_Lists is
---------------
procedure Partition (Pivot : Node_Access; Back : Node_Access) is
Node : Node_Access := Pivot.Next;
Node : Node_Access;
begin
Node := Pivot.Next;
while Node /= Back loop
if Node.Element < Pivot.Element then
declare
......@@ -913,6 +921,7 @@ package body Ada.Containers.Doubly_Linked_Lists is
B := B - 1;
L := L - 1;
exception
when others =>
B := B - 1;
......@@ -954,34 +963,33 @@ package body Ada.Containers.Doubly_Linked_Lists is
if Before.Container /= Container'Unrestricted_Access then
raise Program_Error with
"Before cursor designates wrong list";
end if;
else
pragma Assert (Vet (Before), "bad cursor in Insert");
end if;
end if;
if Count = 0 then
Position := Before;
return;
end if;
if Container.Length > Count_Type'Last - Count then
elsif Container.Length > Count_Type'Last - Count then
raise Constraint_Error with "new length exceeds maximum";
end if;
if Container.Busy > 0 then
elsif Container.Busy > 0 then
raise Program_Error with
"attempt to tamper with cursors (list is busy)";
end if;
else
New_Node := new Node_Type'(New_Item, null, null);
Insert_Internal (Container, Before.Node, New_Node);
Position := Cursor'(Container'Unchecked_Access, New_Node);
for J in Count_Type'(2) .. Count loop
for J in 2 .. Count loop
New_Node := new Node_Type'(New_Item, null, null);
Insert_Internal (Container, Before.Node, New_Node);
end loop;
end if;
end Insert;
procedure Insert
......@@ -1009,10 +1017,10 @@ package body Ada.Containers.Doubly_Linked_Lists is
if Before.Container /= Container'Unrestricted_Access then
raise Program_Error with
"Before cursor designates wrong list";
end if;
else
pragma Assert (Vet (Before), "bad cursor in Insert");
end if;
end if;
if Count = 0 then
Position := Before;
......@@ -1021,22 +1029,22 @@ package body Ada.Containers.Doubly_Linked_Lists is
if Container.Length > Count_Type'Last - Count then
raise Constraint_Error with "new length exceeds maximum";
end if;
if Container.Busy > 0 then
elsif Container.Busy > 0 then
raise Program_Error with
"attempt to tamper with cursors (list is busy)";
end if;
else
New_Node := new Node_Type;
Insert_Internal (Container, Before.Node, New_Node);
Position := Cursor'(Container'Unchecked_Access, New_Node);
for J in Count_Type'(2) .. Count loop
for J in 2 .. Count loop
New_Node := new Node_Type;
Insert_Internal (Container, Before.Node, New_Node);
end loop;
end if;
end Insert;
---------------------
......@@ -1169,23 +1177,22 @@ package body Ada.Containers.Doubly_Linked_Lists is
if Start = No_Element then
raise Constraint_Error with
"Start position for iterator equals No_Element";
end if;
if Start.Container /= Container'Unrestricted_Access then
elsif Start.Container /= Container'Unrestricted_Access then
raise Program_Error with
"Start cursor of Iterate designates wrong list";
end if;
else
pragma Assert (Vet (Start), "Start cursor of Iterate is bad");
-- The value of the Node component influences the behavior of the First
-- and Last selector functions of the iterator object. When the Node
-- component is non-null (as is the case here), it means that this
-- is a partial iteration, over a subset of the complete sequence of
-- items. The iterator object was constructed with a start expression,
-- indicating the position from which the iteration begins. Note that
-- the start position has the same value irrespective of whether this
-- is a forward or reverse iteration.
-- The value of the Node component influences the behavior of the
-- First and Last selector functions of the iterator object. When
-- the Node component is non-null (as is the case here), it means
-- that this is a partial iteration, over a subset of the complete
-- sequence of items. The iterator object was constructed with
-- a start expression, indicating the position from which the
-- iteration begins. Note that the start position has the same value
-- irrespective of whether this is a forward or reverse iteration.
return It : constant Iterator :=
Iterator'(Limited_Controlled with
......@@ -1194,6 +1201,7 @@ package body Ada.Containers.Doubly_Linked_Lists is
do
B := B + 1;
end return;
end if;
end Iterate;
----------
......@@ -1204,9 +1212,9 @@ package body Ada.Containers.Doubly_Linked_Lists is
begin
if Container.Last = null then
return No_Element;
end if;
else
return Cursor'(Container'Unrestricted_Access, Container.Last);
end if;
end Last;
function Last (Object : Iterator) return Cursor is
......@@ -1239,9 +1247,9 @@ package body Ada.Containers.Doubly_Linked_Lists is
begin
if Container.Last = null then
raise Constraint_Error with "list is empty";
end if;
else
return Container.Last.Element;
end if;
end Last_Element;
------------
......@@ -1264,13 +1272,12 @@ package body Ada.Containers.Doubly_Linked_Lists is
begin
if Target'Address = Source'Address then
return;
end if;
if Source.Busy > 0 then
elsif Source.Busy > 0 then
raise Program_Error with
"attempt to tamper with cursors of Source (list is busy)";
end if;
else
Clear (Target);
Target.First := Source.First;
......@@ -1281,6 +1288,7 @@ package body Ada.Containers.Doubly_Linked_Lists is
Target.Length := Source.Length;
Source.Length := 0;
end if;
end Move;
----------
......@@ -1296,20 +1304,20 @@ package body Ada.Containers.Doubly_Linked_Lists is
begin
if Position.Node = null then
return No_Element;
end if;
else
pragma Assert (Vet (Position), "bad cursor in Next");
declare
Next_Node : constant Node_Access := Position.Node.Next;
begin
if Next_Node = null then
return No_Element;
end if;
else
return Cursor'(Position.Container, Next_Node);
end if;
end;
end if;
end Next;
function Next
......@@ -1319,14 +1327,12 @@ package body Ada.Containers.Doubly_Linked_Lists is
begin
if Position.Container = null then
return No_Element;
end if;
if Position.Container /= Object.Container then
elsif Position.Container /= Object.Container then
raise Program_Error with
"Position cursor of Next designates wrong list";
end if;
else
return Next (Position);
end if;
end Next;
-------------
......@@ -1355,20 +1361,20 @@ package body Ada.Containers.Doubly_Linked_Lists is
begin
if Position.Node = null then
return No_Element;
end if;
else
pragma Assert (Vet (Position), "bad cursor in Previous");
declare
Prev_Node : constant Node_Access := Position.Node.Prev;
begin
if Prev_Node = null then
return No_Element;
end if;
else
return Cursor'(Position.Container, Prev_Node);
end if;
end;
end if;
end Previous;
function Previous
......@@ -1378,14 +1384,12 @@ package body Ada.Containers.Doubly_Linked_Lists is
begin
if Position.Container = null then
return No_Element;
end if;
if Position.Container /= Object.Container then
elsif Position.Container /= Object.Container then
raise Program_Error with
"Position cursor of Previous designates wrong list";
end if;
else
return Previous (Position);
end if;
end Previous;
-------------------
......@@ -1514,13 +1518,12 @@ package body Ada.Containers.Doubly_Linked_Lists is
begin
if Position.Container = null then
raise Constraint_Error with "Position cursor has no element";
end if;
if Position.Container /= Container'Unchecked_Access then
elsif Position.Container /= Container'Unchecked_Access then
raise Program_Error with
"Position cursor designates wrong container";
end if;
else
pragma Assert (Vet (Position), "bad cursor in function Reference");
declare
......@@ -1536,6 +1539,7 @@ package body Ada.Containers.Doubly_Linked_Lists is
L := L + 1;
end return;
end;
end if;
end Reference;
---------------------
......@@ -1550,21 +1554,20 @@ package body Ada.Containers.Doubly_Linked_Lists is
begin
if Position.Container = null then
raise Constraint_Error with "Position cursor has no element";
end if;
if Position.Container /= Container'Unchecked_Access then
elsif Position.Container /= Container'Unchecked_Access then
raise Program_Error with
"Position cursor designates wrong container";
end if;
if Container.Lock > 0 then
elsif Container.Lock > 0 then
raise Program_Error with
"attempt to tamper with elements (list is locked)";
end if;
else
pragma Assert (Vet (Position), "bad cursor in Replace_Element");
Position.Node.Element := New_Item;
end if;
end Replace_Element;
----------------------
......@@ -1673,10 +1676,10 @@ package body Ada.Containers.Doubly_Linked_Lists is
if Position.Container /= Container'Unrestricted_Access then
raise Program_Error with
"Position cursor designates wrong container";
end if;
else
pragma Assert (Vet (Position), "bad cursor in Reverse_Find");
end if;
end if;
-- Per AI05-0022, the container implementation is required to detect
-- element tampering by a generic actual subprogram.
......@@ -1709,6 +1712,7 @@ package body Ada.Containers.Doubly_Linked_Lists is
else
return Cursor'(Container'Unrestricted_Access, Result);
end if;
exception
when others =>
B := B - 1;
......@@ -1738,7 +1742,6 @@ package body Ada.Containers.Doubly_Linked_Lists is
Process (Cursor'(Container'Unrestricted_Access, Node));
Node := Node.Prev;
end loop;
exception
when others =>
B := B - 1;
......@@ -1762,32 +1765,28 @@ package body Ada.Containers.Doubly_Linked_Lists is
if Before.Container /= Target'Unrestricted_Access then
raise Program_Error with
"Before cursor designates wrong container";
end if;
else
pragma Assert (Vet (Before), "bad cursor in Splice");
end if;
end if;
if Target'Address = Source'Address
or else Source.Length = 0
then
if Target'Address = Source'Address or else Source.Length = 0 then
return;
end if;
if Target.Length > Count_Type'Last - Source.Length then
elsif Target.Length > Count_Type'Last - Source.Length then
raise Constraint_Error with "new length exceeds maximum";
end if;
if Target.Busy > 0 then
elsif Target.Busy > 0 then
raise Program_Error with
"attempt to tamper with cursors of Target (list is busy)";
end if;
if Source.Busy > 0 then
elsif Source.Busy > 0 then
raise Program_Error with
"attempt to tamper with cursors of Source (list is busy)";
end if;
else
Splice_Internal (Target, Before.Node, Source);
end if;
end Splice;
procedure Splice
......@@ -1800,10 +1799,10 @@ package body Ada.Containers.Doubly_Linked_Lists is
if Before.Container /= Container'Unchecked_Access then
raise Program_Error with
"Before cursor designates wrong container";
end if;
else
pragma Assert (Vet (Before), "bad Before cursor in Splice");
end if;
end if;
if Position.Node = null then
raise Constraint_Error with "Position cursor has no element";
......@@ -1908,38 +1907,37 @@ package body Ada.Containers.Doubly_Linked_Lists is
if Before.Container /= Target'Unrestricted_Access then
raise Program_Error with
"Before cursor designates wrong container";
end if;
else
pragma Assert (Vet (Before), "bad Before cursor in Splice");
end if;
end if;
if Position.Node = null then
raise Constraint_Error with "Position cursor has no element";
end if;
if Position.Container /= Source'Unrestricted_Access then
elsif Position.Container /= Source'Unrestricted_Access then
raise Program_Error with
"Position cursor designates wrong container";
end if;
else
pragma Assert (Vet (Position), "bad Position cursor in Splice");
if Target.Length = Count_Type'Last then
raise Constraint_Error with "Target is full";
end if;
if Target.Busy > 0 then
elsif Target.Busy > 0 then
raise Program_Error with
"attempt to tamper with cursors of Target (list is busy)";
end if;
if Source.Busy > 0 then
elsif Source.Busy > 0 then
raise Program_Error with
"attempt to tamper with cursors of Source (list is busy)";
end if;
else
Splice_Internal (Target, Before.Node, Source, Position.Node);
Position.Container := Target'Unchecked_Access;
end if;
end if;
end Splice;
---------------------
......@@ -2210,13 +2208,12 @@ package body Ada.Containers.Doubly_Linked_Lists is
begin
if Position.Node = null then
raise Constraint_Error with "Position cursor has no element";
end if;
if Position.Container /= Container'Unchecked_Access then
elsif Position.Container /= Container'Unchecked_Access then
raise Program_Error with
"Position cursor designates wrong container";
end if;
else
pragma Assert (Vet (Position), "bad cursor in Update_Element");
declare
......@@ -2239,6 +2236,7 @@ package body Ada.Containers.Doubly_Linked_Lists is
L := L - 1;
B := B - 1;
end;
end if;
end Update_Element;
---------
......@@ -2305,8 +2303,7 @@ package body Ada.Containers.Doubly_Linked_Lists is
end if;
pragma Assert
(Position.Node.Prev /= null
or else Position.Node = L.First);
(Position.Node.Prev /= null or else Position.Node = L.First);
if Position.Node.Next = null and then Position.Node /= L.Last then
return False;
......
......@@ -138,6 +138,7 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
LR := LR - 1;
return Result;
exception
when others =>
BL := BL - 1;
......@@ -247,8 +248,8 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
begin
if Target'Address = Source'Address then
return;
end if;
else
Target.Clear;
Node := Source.First;
......@@ -256,6 +257,7 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
Target.Append (Node.Element.all);
Node := Node.Next;
end loop;
end if;
end Assign;
-----------
......@@ -316,17 +318,14 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
begin
if Position.Container = null then
raise Constraint_Error with "Position cursor has no element";
end if;
if Position.Container /= Container'Unrestricted_Access then
elsif Position.Container /= Container'Unrestricted_Access then
raise Program_Error with
"Position cursor designates wrong container";
end if;
if Position.Node.Element = null then
elsif Position.Node.Element = null then
raise Program_Error with "Node has no element";
end if;
else
pragma Assert (Vet (Position), "bad cursor in Constant_Reference");
declare
......@@ -342,6 +341,7 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
L := L + 1;
end return;
end;
end if;
end Constant_Reference;
--------------
......@@ -434,6 +434,8 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
Free (X);
end loop;
-- Fix this junk comment ???
Position := No_Element; -- Post-York behavior
end Delete;
......@@ -451,18 +453,16 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
if Count >= Container.Length then
Clear (Container);
return;
end if;
if Count = 0 then
elsif Count = 0 then
return;
end if;
if Container.Busy > 0 then
elsif Container.Busy > 0 then
raise Program_Error with
"attempt to tamper with cursors (list is busy)";
end if;
for I in 1 .. Count loop
else
for J in 1 .. Count loop
X := Container.First;
pragma Assert (X.Next.Prev = Container.First);
......@@ -473,6 +473,7 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
Free (X);
end loop;
end if;
end Delete_First;
-----------------
......@@ -489,18 +490,16 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
if Count >= Container.Length then
Clear (Container);
return;
end if;
if Count = 0 then
elsif Count = 0 then
return;
end if;
if Container.Busy > 0 then
elsif Container.Busy > 0 then
raise Program_Error with
"attempt to tamper with cursors (list is busy)";
end if;
for I in 1 .. Count loop
else
for J in 1 .. Count loop
X := Container.Last;
pragma Assert (X.Prev.Next = Container.Last);
......@@ -511,6 +510,7 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
Free (X);
end loop;
end if;
end Delete_Last;
-------------
......@@ -522,16 +522,16 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
if Position.Node = null then
raise Constraint_Error with
"Position cursor has no element";
end if;
if Position.Node.Element = null then
elsif Position.Node.Element = null then
raise Program_Error with
"Position cursor has no element";
end if;
else
pragma Assert (Vet (Position), "bad cursor in Element");
return Position.Node.Element.all;
end if;
end Element;
--------------
......@@ -583,15 +583,15 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
else
if Node.Element = null then
raise Program_Error;
end if;
if Position.Container /= Container'Unrestricted_Access then
elsif Position.Container /= Container'Unrestricted_Access then
raise Program_Error with
"Position cursor designates wrong container";
end if;
else
pragma Assert (Vet (Position), "bad cursor in Find");
end if;
end if;
-- Per AI05-0022, the container implementation is required to detect
-- element tampering by a generic actual subprogram.
......@@ -624,6 +624,7 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
else
return Cursor'(Container'Unrestricted_Access, Result);
end if;
exception
when others =>
B := B - 1;
......@@ -640,9 +641,9 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
begin
if Container.First = null then
return No_Element;
end if;
else
return Cursor'(Container'Unrestricted_Access, Container.First);
end if;
end First;
function First (Object : Iterator) return Cursor is
......@@ -675,9 +676,9 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
begin
if Container.First = null then
raise Constraint_Error with "list is empty";
end if;
else
return Container.First.Element.all;
end if;
end First_Element;
----------
......@@ -747,7 +748,7 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
Node := Container.First;
Result := True;
for I in 2 .. Container.Length loop
for J in 2 .. Container.Length loop
if Node.Next.Element.all < Node.Element.all then
Result := False;
exit;
......@@ -760,6 +761,7 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
L := L - 1;
return Result;
exception
when others =>
B := B - 1;
......@@ -786,23 +788,19 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
if Source.Is_Empty then
return;
end if;
if Target'Address = Source'Address then
elsif Target'Address = Source'Address then
raise Program_Error with
"Target and Source denote same non-empty container";
end if;
if Target.Length > Count_Type'Last - Source.Length then
elsif Target.Length > Count_Type'Last - Source.Length then
raise Constraint_Error with "new length exceeds maximum";
end if;
if Target.Busy > 0 then
elsif Target.Busy > 0 then
raise Program_Error with
"attempt to tamper with cursors of Target (list is busy)";
end if;
if Source.Busy > 0 then
elsif Source.Busy > 0 then
raise Program_Error with
"attempt to tamper with cursors of Source (list is busy)";
end if;
......@@ -854,6 +852,7 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
SB := SB - 1;
SL := SL - 1;
exception
when others =>
TB := TB - 1;
......@@ -872,22 +871,26 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
procedure Sort (Container : in out List) is
procedure Partition (Pivot : Node_Access; Back : Node_Access);
-- Comment ???
procedure Sort (Front, Back : Node_Access);
-- Comment??? Confusing name??? change name???
---------------
-- Partition --
---------------
procedure Partition (Pivot : Node_Access; Back : Node_Access) is
Node : Node_Access := Pivot.Next;
Node : Node_Access;
begin
Node := Pivot.Next;
while Node /= Back loop
if Node.Element.all < Pivot.Element.all then
declare
Prev : constant Node_Access := Node.Prev;
Next : constant Node_Access := Node.Next;
begin
Prev.Next := Next;
......@@ -1003,17 +1006,15 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
if Before.Container /= Container'Unrestricted_Access then
raise Program_Error with
"attempt to tamper with cursors (list is busy)";
end if;
if Before.Node = null
or else Before.Node.Element = null
then
elsif Before.Node = null or else Before.Node.Element = null then
raise Program_Error with
"Before cursor has no element";
end if;
else
pragma Assert (Vet (Before), "bad cursor in Insert");
end if;
end if;
if Count = 0 then
Position := Before;
......@@ -1052,8 +1053,7 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
Insert_Internal (Container, Before.Node, New_Node);
Position := Cursor'(Container'Unchecked_Access, New_Node);
for J in Count_Type'(2) .. Count loop
for J in 2 .. Count loop
declare
Element : Element_Access := new Element_Type'(New_Item);
begin
......@@ -1213,23 +1213,22 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
if Start = No_Element then
raise Constraint_Error with
"Start position for iterator equals No_Element";
end if;
if Start.Container /= Container'Unrestricted_Access then
elsif Start.Container /= Container'Unrestricted_Access then
raise Program_Error with
"Start cursor of Iterate designates wrong list";
end if;
else
pragma Assert (Vet (Start), "Start cursor of Iterate is bad");
-- The value of the Node component influences the behavior of the First
-- and Last selector functions of the iterator object. When the Node
-- component is non-null (as is the case here), it means that this
-- is a partial iteration, over a subset of the complete sequence of
-- items. The iterator object was constructed with a start expression,
-- indicating the position from which the iteration begins. Note that
-- the start position has the same value irrespective of whether this
-- is a forward or reverse iteration.
-- The value of the Node component influences the behavior of the
-- First and Last selector functions of the iterator object. When
-- the Node component is non-null (as is the case here), it means
-- that this is a partial iteration, over a subset of the complete
-- sequence of items. The iterator object was constructed with
-- a start expression, indicating the position from which the
-- iteration begins. Note that the start position has the same value
-- irrespective of whether this is a forward or reverse iteration.
return It : constant Iterator :=
Iterator'(Limited_Controlled with
......@@ -1238,6 +1237,7 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
do
B := B + 1;
end return;
end if;
end Iterate;
----------
......@@ -1248,9 +1248,9 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
begin
if Container.Last = null then
return No_Element;
end if;
else
return Cursor'(Container'Unrestricted_Access, Container.Last);
end if;
end Last;
function Last (Object : Iterator) return Cursor is
......@@ -1283,9 +1283,9 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
begin
if Container.Last = null then
raise Constraint_Error with "list is empty";
end if;
else
return Container.Last.Element.all;
end if;
end Last_Element;
------------
......@@ -1305,13 +1305,12 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
begin
if Target'Address = Source'Address then
return;
end if;
if Source.Busy > 0 then
elsif Source.Busy > 0 then
raise Program_Error with
"attempt to tamper with cursors of Source (list is busy)";
end if;
else
Clear (Target);
Target.First := Source.First;
......@@ -1322,6 +1321,7 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
Target.Length := Source.Length;
Source.Length := 0;
end if;
end Move;
----------
......@@ -1337,8 +1337,8 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
begin
if Position.Node = null then
return No_Element;
end if;
else
pragma Assert (Vet (Position), "bad cursor in Next");
declare
......@@ -1346,24 +1346,23 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
begin
if Next_Node = null then
return No_Element;
end if;
else
return Cursor'(Position.Container, Next_Node);
end if;
end;
end if;
end Next;
function Next (Object : Iterator; Position : Cursor) return Cursor is
begin
if Position.Container = null then
return No_Element;
end if;
if Position.Container /= Object.Container then
elsif Position.Container /= Object.Container then
raise Program_Error with
"Position cursor of Next designates wrong list";
end if;
else
return Next (Position);
end if;
end Next;
-------------
......@@ -1392,8 +1391,8 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
begin
if Position.Node = null then
return No_Element;
end if;
else
pragma Assert (Vet (Position), "bad cursor in Previous");
declare
......@@ -1401,24 +1400,23 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
begin
if Prev_Node = null then
return No_Element;
end if;
else
return Cursor'(Position.Container, Prev_Node);
end if;
end;
end if;
end Previous;
function Previous (Object : Iterator; Position : Cursor) return Cursor is
begin
if Position.Container = null then
return No_Element;
end if;
if Position.Container /= Object.Container then
elsif Position.Container /= Object.Container then
raise Program_Error with
"Position cursor of Previous designates wrong list";
end if;
else
return Previous (Position);
end if;
end Previous;
-------------------
......@@ -1433,13 +1431,12 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
if Position.Node = null then
raise Constraint_Error with
"Position cursor has no element";
end if;
if Position.Node.Element = null then
elsif Position.Node.Element = null then
raise Program_Error with
"Position cursor has no element";
end if;
else
pragma Assert (Vet (Position), "bad cursor in Query_Element");
declare
......@@ -1463,6 +1460,7 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
L := L - 1;
B := B - 1;
end;
end if;
end Query_Element;
----------
......@@ -1553,17 +1551,15 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
begin
if Position.Container = null then
raise Constraint_Error with "Position cursor has no element";
end if;
if Position.Container /= Container'Unrestricted_Access then
elsif Position.Container /= Container'Unrestricted_Access then
raise Program_Error with
"Position cursor designates wrong container";
end if;
if Position.Node.Element = null then
elsif Position.Node.Element = null then
raise Program_Error with "Node has no element";
end if;
else
pragma Assert (Vet (Position), "bad cursor in function Reference");
declare
......@@ -1579,6 +1575,7 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
L := L + 1;
end return;
end;
end if;
end Reference;
---------------------
......@@ -1593,29 +1590,26 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
begin
if Position.Container = null then
raise Constraint_Error with "Position cursor has no element";
end if;
if Position.Container /= Container'Unchecked_Access then
elsif Position.Container /= Container'Unchecked_Access then
raise Program_Error with
"Position cursor designates wrong container";
end if;
if Container.Lock > 0 then
elsif Container.Lock > 0 then
raise Program_Error with
"attempt to tamper with elements (list is locked)";
end if;
if Position.Node.Element = null then
elsif Position.Node.Element = null then
raise Program_Error with
"Position cursor has no element";
end if;
else
pragma Assert (Vet (Position), "bad cursor in Replace_Element");
declare
-- The element allocator may need an accessibility check in the case
-- the actual type is class-wide or has access discriminants (see
-- RM 4.8(10.1) and AI12-0035).
-- The element allocator may need an accessibility check in the
-- case the actual type is class-wide or has access discriminants
-- (see RM 4.8(10.1) and AI12-0035).
pragma Unsuppress (Accessibility_Check);
......@@ -1625,6 +1619,7 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
Position.Node.Element := new Element_Type'(New_Item);
Free (X);
end;
end if;
end Replace_Element;
----------------------
......@@ -1732,15 +1727,15 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
else
if Node.Element = null then
raise Program_Error with "Position cursor has no element";
end if;
if Position.Container /= Container'Unrestricted_Access then
elsif Position.Container /= Container'Unrestricted_Access then
raise Program_Error with
"Position cursor designates wrong container";
end if;
else
pragma Assert (Vet (Position), "bad cursor in Reverse_Find");
end if;
end if;
-- Per AI05-0022, the container implementation is required to detect
-- element tampering by a generic actual subprogram.
......@@ -1773,6 +1768,7 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
else
return Cursor'(Container'Unrestricted_Access, Result);
end if;
exception
when others =>
B := B - 1;
......@@ -1825,39 +1821,33 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
if Before.Container /= Target'Unrestricted_Access then
raise Program_Error with
"Before cursor designates wrong container";
end if;
if Before.Node = null
or else Before.Node.Element = null
then
elsif Before.Node = null or else Before.Node.Element = null then
raise Program_Error with
"Before cursor has no element";
end if;
else
pragma Assert (Vet (Before), "bad cursor in Splice");
end if;
end if;
if Target'Address = Source'Address
or else Source.Length = 0
then
if Target'Address = Source'Address or else Source.Length = 0 then
return;
end if;
if Target.Length > Count_Type'Last - Source.Length then
elsif Target.Length > Count_Type'Last - Source.Length then
raise Constraint_Error with "new length exceeds maximum";
end if;
if Target.Busy > 0 then
elsif Target.Busy > 0 then
raise Program_Error with
"attempt to tamper with cursors of Target (list is busy)";
end if;
if Source.Busy > 0 then
elsif Source.Busy > 0 then
raise Program_Error with
"attempt to tamper with cursors of Source (list is busy)";
end if;
else
Splice_Internal (Target, Before.Node, Source);
end if;
end Splice;
procedure Splice
......@@ -1870,17 +1860,15 @@ package body Ada.Containers.Indefinite_Doubly_Linked_Lists is
if Before.Container /= Container'Unchecked_Access then
raise Program_Error with
"Before cursor designates wrong container";
end if;
if Before.Node = null
or else Before.Node.Element = null
then
elsif Before.Node = null or else Before.Node.Element = null then
raise Program_Error with
"Before cursor has no element";
end if;
else
pragma Assert (Vet (Before), "bad Before cursor in Splice");
end if;
end if;
if Position.Node = null then
raise Constraint_Error with "Position cursor has no element";
......
......@@ -234,8 +234,15 @@ package body Adabkend is
then
if Is_Switch (Argv) then
Fail ("Object file name missing after -gnatO");
-- In Alfa_Mode, such an object file is never written, and the
-- call to Set_Output_Object_File_Name may fail (e.g. when the
-- object file name does not have the expected suffix). So we
-- skip that call when Alfa_Mode is set.
elsif Alfa_Mode then
Output_File_Name_Seen := True;
else
Set_Output_Object_File_Name (Argv);
Output_File_Name_Seen := True;
......
......@@ -3244,13 +3244,18 @@ package body Checks is
Reason => CE_Discriminant_Check_Failed));
end;
-- For arrays, conversions are applied during expansion, to take into
-- accounts changes of representation. The checks become range checks on
-- the base type or length checks on the subtype, depending on whether
-- the target type is unconstrained or constrained.
-- For arrays, checks are set now, but conversions are applied during
-- expansion, to take into accounts changes of representation. The
-- checks become range checks on the base type or length checks on the
-- subtype, depending on whether the target type is unconstrained or
-- constrained.
elsif Is_Array_Type (Target_Type) then
if Is_Constrained (Target_Type) then
Set_Do_Length_Check (N);
else
null;
Set_Do_Range_Check (Expr);
end if;
end if;
end Apply_Type_Conversion_Checks;
......
......@@ -126,7 +126,7 @@ package body Debug is
-- d.F Alfa mode
-- d.G Frame condition mode for gnat2why
-- d.H Standard package only mode for gnat2why
-- d.I
-- d.I Do not ignore enum representation clauses in CodePeer mode
-- d.J Disable parallel SCIL generation mode
-- d.K Alfa detection only mode for gnat2why
-- d.L Depend on back end for limited types in if and case expressions
......@@ -614,6 +614,12 @@ package body Debug is
-- will only generate Why code for package Standard. Any given input
-- file will be ignored.
-- d.I Do not ignore enum representation clauses in CodePeer mode.
-- The default of ignoring representation clauses for enumeration
-- types in CodePeer is good for the majority of Ada code, but in some
-- cases being able to change this default might be useful to remove
-- some false positives.
-- d.J Disable parallel SCIL generation. Normally SCIL file generation is
-- done in parallel to speed processing. This switch disables this
-- behavior.
......
......@@ -293,11 +293,15 @@ procedure Gnat1drv is
Formal_Extensions := True;
end if;
-- Alfa_Mode is activated by default in the gnat2why executable, but
-- can also be activated using the -gnatd.F switch.
-- Enable Alfa_Mode when using -gnatd.F switch
if Debug_Flag_Dot_FF or else Alfa_Mode then
if Debug_Flag_Dot_FF then
Alfa_Mode := True;
end if;
-- Alfa_Mode is also activated by default in the gnat2why executable
if Alfa_Mode then
-- Set strict standard interpretation of compiler permissions
......
......@@ -26,6 +26,7 @@
with Aspects; use Aspects;
with Atree; use Atree;
with Checks; use Checks;
with Debug; use Debug;
with Einfo; use Einfo;
with Elists; use Elists;
with Errout; use Errout;
......@@ -4253,6 +4254,14 @@ package body Sem_Ch13 is
return;
end if;
-- Ignore enumeration rep clauses by default in CodePeer mode,
-- unless -gnatd.I is specified, as a work around for potential false
-- positive messages.
if CodePeer_Mode and not Debug_Flag_Dot_II then
return;
end if;
-- First some basic error checks
Find_Type (Ident);
......
......@@ -12984,6 +12984,19 @@ package body Sem_Util is
else
Desc := P;
P := Parent (P);
-- A special Ada 2012 case: the original node may be part
-- of the else_actions of a conditional expression, in which
-- case it might not have been expanded yet, and appears in
-- a non-syntactic list of actions. In that case it is clearly
-- not safe to save a value.
if No (P)
and then Is_List_Member (Desc)
and then No (Parent (List_Containing (Desc)))
then
return False;
end if;
end if;
end loop;
end;
......
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