Build_Class_Condition_Subprograms calls Make_Class_Precondition_Subps on 
Is_Primitive_Wrapper subprograms too.

Tested on x86-64/Linux, applied on the mainline and 16 branch.


2026-10-14  Eric Botcazou  <[email protected]>

        PR ada/127880
        * contracts.adb (Make_Class_Precondition_Subps): Accept another
        kind of wrapper subprograms.

-- 
Eric Botcazou
diff --git a/gcc/ada/contracts.adb b/gcc/ada/contracts.adb
index fb781fd6ac3..1e97e71b176 100644
--- a/gcc/ada/contracts.adb
+++ b/gcc/ada/contracts.adb
@@ -4246,7 +4246,8 @@ package body Contracts is
       then
          pragma Assert
            (Comes_From_Source (Subp_Id)
-              or else Is_Dispatch_Table_Wrapper (Subp_Id));
+             or else Is_Dispatch_Table_Wrapper (Subp_Id)
+             or else Is_Primitive_Wrapper (Subp_Id));
 
          if No (Dynamic_Call_Helper (Subp_Id)) then
 

Reply via email to