]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/ada/sem_util.adb
[Ada] Debug info not available on subp having a class-wide precondition
[thirdparty/gcc.git] / gcc / ada / sem_util.adb
index b73c1f6e6236bc5c51d5d03ad0e3a47ceb5cfcd7..6c197b517d51611da9287ee1d58eef450899ff91 100644 (file)
@@ -1618,6 +1618,13 @@ package body Sem_Util is
       --  wrapper call to inherited operation.
 
       Set_Class_Wide_Clone (Spec_Id, Clone_Id);
+
+      --  Inherit debug info flag from Spec_Id to Clone_Id to allow debugging
+      --  of the class-wide clone subprogram.
+
+      if Needs_Debug_Info (Spec_Id) then
+         Set_Debug_Info_Needed (Clone_Id);
+      end if;
    end Build_Class_Wide_Clone_Decl;
 
    -----------------------------