The compiler no longer warns about unused use clauses, unused
declarations, and the like, if errors were already detected. This is an
improvement, because the errors can hide the relevant uses, and thus
cause things to look "unused" when they are not.

Tested on x86_64-pc-linux-gnu, committed on trunk

2019-12-16  Bob Duff  <d...@adacore.com>

gcc/ada/

        * errout.adb (Handle_Serious_Error): Disable the above-mentioned
        warnings.
--- gcc/ada/errout.adb
+++ gcc/ada/errout.adb
@@ -861,6 +861,14 @@ package body Errout is
                end if;
             end;
          end if;
+
+         --  Disable warnings on unused use clauses and the like. Otherwise, an
+         --  error might hide a reference to an entity in a used package, so
+         --  after fixing the error, the use clause no longer looks like it was
+         --  unused.
+
+         Check_Unreferenced := False;
+         Check_Unreferenced_Formals := False;
       end Handle_Serious_Error;
 
    --  Start of processing for Error_Msg_Internal

Reply via email to