]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Remove spurious warnings about No_Exception_Propagation in GNATprove mode
authorMartin Clochard <clochard@adacore.com>
Tue, 6 May 2025 13:59:16 +0000 (15:59 +0200)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Tue, 1 Jul 2025 08:29:40 +0000 (10:29 +0200)
gcc/ada/ChangeLog:

* frontend.adb (Frontend): do not override GNATprove's setting for
Warn_On_Non_Local_Exception

gcc/ada/frontend.adb

index d5376788ce42ef5fbf0d3fae4041ecd2b434d5e3..564f153c9826e21fb5207cc6f8aa928abe63aac7 100644 (file)
@@ -368,11 +368,12 @@ begin
       --  If we have restriction No_Exception_Propagation, and we did not have
       --  an explicit switch turning off Warn_On_Non_Local_Exception, then turn
       --  on this warning by default if we have encountered an exception
-      --  handler.
+      --  handler. We do not override the setting of GNATprove.
 
       if Restriction_Check_Required (No_Exception_Propagation)
         and then not No_Warn_On_Non_Local_Exception
         and then Exception_Handler_Encountered
+        and then not GNATprove_Mode
       then
          Warn_On_Non_Local_Exception := True;
       end if;