]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Ignore defered compile time errors without backend
authorViljar Indus <indus@adacore.com>
Thu, 16 Nov 2023 12:51:13 +0000 (14:51 +0200)
committerMarc Poulhiès <poulhies@adacore.com>
Thu, 30 Nov 2023 10:12:48 +0000 (11:12 +0100)
We defer some compile time warnings and errors until the
backend has added the extra information needed. However
it is not guaranteed that the backend has run by this point.
Avoid checking these errors if the backend has not been activated
and no code has been generated.

gcc/ada/

* sem_prag.adb (Validate_Compile_Time_Warning_Errors): Avoid
checking compile time warnings and errors if backend has not been
activated.

gcc/ada/sem_prag.adb

index 02f6f29c8a8d41b7851666e7b7d2654cfc2f5180..bd1d9d3d59bf8316c3fb812c35c540a2462f64d7 100644 (file)
@@ -33972,6 +33972,16 @@ package body Sem_Prag is
    --  Start of processing for Validate_Compile_Time_Warning_Errors
 
    begin
+
+      --  These error/warning messages were deferred because they could not be
+      --  evaluated in the front-end and they needed additional information
+      --  from the back-end. There is no reason to run these checks again if
+      --  the back-end was not activated by this point.
+
+      if not Generating_Code then
+         return;
+      end if;
+
       Expander_Mode_Save_And_Set (False);
       In_Compile_Time_Warning_Or_Error := True;