[Ada] Spurious assert failure in Walk_Library_Items
authorArnaud Charlet <charlet@adacore.com>
Sun, 2 Feb 2020 18:42:50 +0000 (19:42 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Fri, 5 Jun 2020 12:17:49 +0000 (08:17 -0400)
2020-06-05  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

* sem.adb (Assert_Done): Relax check for main unit, as it was
overzealous in the case of the main unit itself.

gcc/ada/sem.adb

index 2c5c54b..5a723f3 100644 (file)
@@ -1842,7 +1842,9 @@ package body Sem is
 
                procedure Assert_Done (Withed_Unit : Node_Id) is
                begin
-                  if not Done (Get_Cunit_Unit_Number (Withed_Unit)) then
+                  if Withed_Unit /= Main_CU
+                    and then not Done (Get_Cunit_Unit_Number (Withed_Unit))
+                  then
                      if not Nkind_In
                               (Unit (Withed_Unit),
                                  N_Generic_Package_Declaration,