]> gcc.gnu.org Git - gcc.git/blobdiff - gcc/ada/exp_util.adb
checks.adb (Safe_To_Capture_In_Parameter_Value): Deal with case expression (cannot...
[gcc.git] / gcc / ada / exp_util.adb
index 4f2e7f7399d982cdd42e0727d37f03b992857ef1..e8a85103be8714d383e8b1580a115541d3ebf99d 100644 (file)
@@ -2417,6 +2417,21 @@ package body Exp_Util is
                   end if;
                end;
 
+            --  Alternative of case expression, we place the action in
+            --  the Actions field of the case expression alternative, this
+            --  will be handled when the case expression is expanded.
+
+            when N_Case_Expression_Alternative =>
+               if Present (Actions (P)) then
+                  Insert_List_After_And_Analyze
+                    (Last (Actions (P)), Ins_Actions);
+               else
+                  Set_Actions (P, Ins_Actions);
+                  Analyze_List (Then_Actions (P));
+               end if;
+
+               return;
+
             --  Case of appearing within an Expressions_With_Actions node. We
             --  prepend the actions to the list of actions already there.
 
@@ -2679,6 +2694,7 @@ package body Exp_Util is
                N_Access_To_Object_Definition            |
                N_Aggregate                              |
                N_Allocator                              |
+               N_Case_Expression                        |
                N_Case_Statement_Alternative             |
                N_Character_Literal                      |
                N_Compilation_Unit                       |
This page took 0.029807 seconds and 5 git commands to generate.