Bug 41845 - Limited_Controlled exposes Adjust operation, which should not exist.
Summary: Limited_Controlled exposes Adjust operation, which should not exist.
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: ada (show other bugs)
Version: 4.3.4
: P3 normal
Target Milestone: 4.8.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-27 09:12 UTC by Maciej Sobczak
Modified: 2015-12-05 17:58 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Maciej Sobczak 2009-10-27 09:12:02 UTC
The following should not compile, since the Limited_Controlled has no Adjust operation and the test code uses the "overriding" keyword, which is supposed to catch the attempt to override non-existing operation. Other operation names are detected properly, which indicates that there is some "hidden" Adjust operation that should not be visible to the user code. Hint from comp.lang.ada: this hidden operation is in s-finroo.ads.

Test code that should not compile, but is accepted by GNAT:

with Ada.Finalization;

procedure Test is

   package P is

      type T is new Ada.Finalization.Limited_Controlled
        with null record;

      overriding
      procedure Initialize (X : in out T);

      overriding
      procedure Adjust (X : in out T);

      overriding
      procedure Finalize (X : in out T);

   end P;

   package body P is
      procedure Initialize (X : in out T) is
      begin
         null;
      end Initialize;

      procedure Adjust (X : in out T) is
      begin
         null;
      end Adjust;

      procedure Finalize (X : in out T) is
      begin
         null;
      end Finalize;
   end P;

begin
   null;
end Test;
Comment 1 Eric Botcazou 2015-12-05 17:58:38 UTC
test.adb:14:07: subprogram "Adjust" is not overriding