[Ada] Reference before declaration on C392015
authorArnaud Charlet <charlet@adacore.com>
Mon, 2 Nov 2020 09:17:02 +0000 (10:17 +0100)
committerPierre-Marie de Rodat <derodat@adacore.com>
Fri, 27 Nov 2020 09:16:01 +0000 (04:16 -0500)
gcc/ada/

* exp_ch6.adb (Expand_Call): Properly split
Transform_Function_Array and Modify_Tree_For_C.

gcc/ada/exp_ch6.adb

index 8ef178f433a09631657fbc0c31ebf07d0184cf1c..d98624956b8bcafe68d2813ca413b85c1c1eecf8 100644 (file)
@@ -3656,7 +3656,8 @@ package body Exp_Ch6 is
             --  are passed by pointer in the generated C code, and we cannot
             --  take a pointer from a subprogram call.
 
-            elsif Nkind (Parent (Call_Node)) in N_Subprogram_Call
+            elsif Modify_Tree_For_C
+              and then Nkind (Parent (Call_Node)) in N_Subprogram_Call
               and then Is_Record_Type (Etype (Func_Id))
             then
                declare