diff mbox series

[Ada] Fix false positive of -gnatw.x on trivial instantiation

Message ID 20171109113349.GA106628@adacore.com
State New
Headers show
Series [Ada] Fix false positive of -gnatw.x on trivial instantiation | expand

Commit Message

Pierre-Marie de Rodat Nov. 9, 2017, 11:33 a.m. UTC
As for calls, issuing the -gnatw.x warning on every generic instantiation
results in way too many false positives and thus needs to be stopped.

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

2017-11-09  Eric Botcazou  <ebotcazou@adacore.com>

	* exp_ch11.adb (Possible_Local_Raise): Do not issue the warning for
	generic instantiations either.
diff mbox series

Patch

Index: exp_ch11.adb
===================================================================
--- exp_ch11.adb	(revision 254563)
+++ exp_ch11.adb	(working copy)
@@ -1855,11 +1855,13 @@ 
          --  and the warning is enabled, generate the appropriate warnings.
 
          --  ??? Do not do it for the Call_Marker nodes inserted by the ABE
-         --  mechanism because this generates too many false positives.
+         --  mechanism because this generates too many false positives, or
+         --  for generic instantiations for the same reason.
 
          elsif Warn_On_Non_Local_Exception
            and then Restriction_Active (No_Exception_Propagation)
            and then Nkind (N) /= N_Call_Marker
+           and then Nkind (N) not in N_Generic_Instantiation
          then
             Warn_No_Exception_Propagation_Active (N);