Commit 9caf55e3 by Bob Duff Committed by Arnaud Charlet

frontend.adb (Frontend): Skip -gnatec=gnat.adc switch, because we've already…

frontend.adb (Frontend): Skip -gnatec=gnat.adc switch, because we've already read gnat.adc by default.

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

	* frontend.adb (Frontend): Skip -gnatec=gnat.adc
	switch, because we've already read gnat.adc by default.

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

	* exp_ch5.adb (Get_Default_Iterator): Replace
	"Assert(False)" with "return Iter", because if an iterable
	type is derived from a noniterable one, then we won't find an
	overriding or inherited default iterator.

From-SVN: r251774
parent 6877306f
2017-09-06 Bob Duff <duff@adacore.com>
* frontend.adb (Frontend): Skip -gnatec=gnat.adc
switch, because we've already read gnat.adc by default.
2017-09-06 Bob Duff <duff@adacore.com>
* exp_ch5.adb (Get_Default_Iterator): Replace
"Assert(False)" with "return Iter", because if an iterable
type is derived from a noniterable one, then we won't find an
overriding or inherited default iterator.
2017-09-06 Yannick Moy <moy@adacore.com> 2017-09-06 Yannick Moy <moy@adacore.com>
* sem_warn.adb (Warn_On_Suspicious_Index): Improve warning when the * sem_warn.adb (Warn_On_Suspicious_Index): Improve warning when the
......
...@@ -3934,9 +3934,9 @@ package body Exp_Ch5 is ...@@ -3934,9 +3934,9 @@ package body Exp_Ch5 is
function Get_Default_Iterator function Get_Default_Iterator
(T : Entity_Id) return Entity_Id; (T : Entity_Id) return Entity_Id;
-- If the container is a derived type, the aspect holds the parent -- Return the default iterator for a specific type. If the type is
-- operation. The required one is a primitive of the derived type -- derived, we return the inherited or overridden one if
-- and is either inherited or overridden. Also sets Container_Arg. -- appropriate.
-------------------------- --------------------------
-- Get_Default_Iterator -- -- Get_Default_Iterator --
...@@ -3953,11 +3953,11 @@ package body Exp_Ch5 is ...@@ -3953,11 +3953,11 @@ package body Exp_Ch5 is
begin begin
Container_Arg := New_Copy_Tree (Container); Container_Arg := New_Copy_Tree (Container);
-- A previous version of GNAT allowed indexing aspects to -- A previous version of GNAT allowed indexing aspects to be
-- be redefined on derived container types, while the -- redefined on derived container types, while the default
-- default iterator was inherited from the parent type. -- iterator was inherited from the parent type. This
-- This non-standard extension is preserved temporarily for -- nonstandard extension is preserved for use by the
-- use by the modelling project under debug flag d.X. -- modelling project under debug flag -gnatd.X.
if Debug_Flag_Dot_XX then if Debug_Flag_Dot_XX then
if Base_Type (Etype (Container)) /= if Base_Type (Etype (Container)) /=
...@@ -3995,9 +3995,11 @@ package body Exp_Ch5 is ...@@ -3995,9 +3995,11 @@ package body Exp_Ch5 is
Next_Elmt (Prim); Next_Elmt (Prim);
end loop; end loop;
-- Default iterator must exist -- If we didn't find it, then our parent type is not
-- iterable, so we return the Default_Iterator aspect of
-- this type.
pragma Assert (False); return Iter;
-- Otherwise not a derived type -- Otherwise not a derived type
......
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