diff mbox series

[Ada] Requires_Cleanup_Actions and N_Protected_Body

Message ID 20220517082746.GA1089835@adacore.com
State New
Headers show
Series [Ada] Requires_Cleanup_Actions and N_Protected_Body | expand

Commit Message

Pierre-Marie de Rodat May 17, 2022, 8:27 a.m. UTC
This patch disallows N_Protected_Body from being passed to
Requires_Cleanup_Actions. Protected bodies never need cleanup, and are
never passed to Requires_Cleanup_Actions, which is a good thing, because
it would blow up on Handled_Statement_Sequence, which doesn't exist for
N_Protected_Body.

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

gcc/ada/

	* exp_util.adb (Requires_Cleanup_Actions): Remove
	N_Protected_Body from the case statement, so that case will be
	covered by "raise Program_Error".
diff mbox series

Patch

diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb
--- a/gcc/ada/exp_util.adb
+++ b/gcc/ada/exp_util.adb
@@ -12781,7 +12781,6 @@  package body Exp_Util is
             | N_Block_Statement
             | N_Entry_Body
             | N_Package_Body
-            | N_Protected_Body
             | N_Subprogram_Body
             | N_Task_Body
          =>