This fixes an ICE in ASIS mode (-gnatct switch) on a chain of with clauses
with a terminal limited_with clause of the first member.
Tested on x86_64-suse-linux, applied on the mainline.
2015-05-27 Eric Botcazou <ebotca...@adacore.com>
* gcc-interface/trans.c (elaborate_all_entities): Do not elaborate an
incomplete type coming from a limited_with and whose non-limited view
comes from the main unit.
--
Eric Botcazou
Index: gcc-interface/trans.c
===================================================================
--- gcc-interface/trans.c (revision 223768)
+++ gcc-interface/trans.c (working copy)
@@ -8158,6 +8158,10 @@ elaborate_all_entities (Node_Id gnat_nod
&& Ekind (gnat_entity) != E_Operator
&& !(IN (Ekind (gnat_entity), Type_Kind)
&& !Is_Frozen (gnat_entity))
+ && !(IN (Ekind (gnat_entity), Incomplete_Kind)
+ && From_Limited_With (gnat_entity)
+ && In_Extended_Main_Code_Unit
+ (Non_Limited_View (gnat_entity)))
&& !((Ekind (gnat_entity) == E_Procedure
|| Ekind (gnat_entity) == E_Function)
&& Is_Intrinsic_Subprogram (gnat_entity))