https://gcc.gnu.org/g:5f0163fcc82e1862adef82d66ab876127751f8e3
commit r16-1234-g5f0163fcc82e1862adef82d66ab876127751f8e3 Author: Steve Baird <ba...@adacore.com> Date: Tue Feb 25 13:51:40 2025 -0800 ada: Child unit subprograms are not primitive subprograms If a package declares a type and a child unit of that package is a subprogram with a parameter (or function result) of that type, then that subprogram is not a primitive subprogram of that type. Previously this was handled incorrectly in some cases, leading to incorrect analysis of overriding indicators. gcc/ada/ChangeLog: * sem_util.adb (Collect_Primitive_Operations): When collecting primitive operations, do not include child unit subprograms. Diff: --- gcc/ada/sem_util.adb | 1 + 1 file changed, 1 insertion(+) diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 42f852e336bd..fefb65c6733c 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -5717,6 +5717,7 @@ package body Sem_Util is or else Is_Primitive (Id)) and then Parent_Kind (Parent (Id)) not in N_Formal_Subprogram_Declaration + and then not Is_Child_Unit (Id) then Is_Prim := False;