]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Ada: Fix ICE when building spawn-25.0.0 with GTK support
authorEric Botcazou <ebotcazou@adacore.com>
Thu, 11 Dec 2025 14:58:37 +0000 (15:58 +0100)
committerEric Botcazou <ebotcazou@adacore.com>
Thu, 11 Dec 2025 14:59:46 +0000 (15:59 +0100)
This is a regression introduced on the mainline by the freezing change for
the designated type of anonymous access-to-subprogram types, which has
uncovered a small oversight in Analyze_Subprogram_Instantiation, whereby
we propagate the Convention of the generic subprogram onto the named actual
only, and not onto the anonymous actual built alongside the named one.

gcc/ada/
PR ada/123062
* sem_ch12.adb (Analyze_Subprogram_Instantiation): Also propagate
the Convention and Is_Exported flag onto the anonymous actual.

gcc/ada/sem_ch12.adb

index 750c2c1a06ff798d61207df957cc6cafb35eeb6a..3bff9394c835ca5e141f3a817f93399aed6dacaa 100644 (file)
@@ -7090,7 +7090,10 @@ package body Sem_Ch12 is
            and then Convention (Gen_Unit) /= Convention_Intrinsic
          then
             Set_Convention (Act_Decl_Id, Convention (Gen_Unit));
+            Set_Convention (Anon_Id,     Convention (Gen_Unit));
+
             Set_Is_Exported (Act_Decl_Id, Is_Exported (Gen_Unit));
+            Set_Is_Exported (Anon_Id,     Is_Exported (Gen_Unit));
          end if;
 
          Generate_Definition (Act_Decl_Id);