]> gcc.gnu.org Git - gcc.git/commitdiff
ada: Rework comment in Expand_Ctrl_Function_Call
authorEric Botcazou <ebotcazou@adacore.com>
Fri, 1 Dec 2023 15:53:02 +0000 (16:53 +0100)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 19 Dec 2023 14:27:50 +0000 (15:27 +0100)
This expands on the reason for properly guarding the transformation.

gcc/ada/

* exp_ch6.adb (Expand_Ctrl_Function_Call): Rework last comment.

gcc/ada/exp_ch6.adb

index 195e34a347914b34af1880ea6adc9fc81d90904d..8e4c9035b2248ea47857f2268445cef403dc7a92 100644 (file)
@@ -5477,7 +5477,12 @@ package body Exp_Ch6 is
 
       Set_Analyzed (N);
 
-      --  Apply the transformation, unless it was already applied manually
+      --  Apply the transformation unless it was already applied earlier. This
+      --  may happen because Remove_Side_Effects can be called during semantic
+      --  analysis, for example from Build_Actual_Subtype_Of_Component. It is
+      --  crucial to avoid creating a reference of reference here, because it
+      --  would not be subsequently recognized by the Is_Finalizable_Transient
+      --  and Requires_Cleanup_Actions predicates.
 
       if Nkind (Par) /= N_Reference then
          Remove_Side_Effects (N);
This page took 0.057965 seconds and 5 git commands to generate.