[Ada] Only unnest subprograms if no previous errors were detected
authorArnaud Charlet <charlet@adacore.com>
Mon, 16 Jul 2018 14:12:23 +0000 (14:12 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Mon, 16 Jul 2018 14:12:23 +0000 (14:12 +0000)
2018-07-16  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

* frontend.adb: Only unnest subprograms if no previous errors were
 detected.

From-SVN: r262729

gcc/ada/ChangeLog
gcc/ada/frontend.adb

index cea35021a1de368dcf5685d1f4e08c6cfea982be..2f860ac4e409f30b3da6867640511fe4f8c3666e 100644 (file)
@@ -1,3 +1,8 @@
+2018-07-16  Arnaud Charlet  <charlet@adacore.com>
+
+       * frontend.adb: Only unnest subprograms if no previous errors were
+        detected.
+
 2018-07-16  Ed Schonberg  <schonberg@adacore.com>
 
        * exp_ch7.adb (Check_Unnesting_Elaboration_Code): Handle loops that
index 730062bd8ccb4c43b7830e7b334590e21df8ba08..48a5d81492244cce26bf0e96e42bc06a9d5e89b0 100644 (file)
@@ -466,7 +466,9 @@ begin
 
             --  At this stage we can unnest subprogram bodies if required
 
-            Exp_Unst.Unnest_Subprograms (Cunit (Main_Unit));
+            if Total_Errors_Detected = 0 then
+               Exp_Unst.Unnest_Subprograms (Cunit (Main_Unit));
+            end if;
 
             --  List library units if requested