Protected type cannot have access taken from its body.
The following should work:

   protected type P is
      procedure Foo;
   end P;

   protected body P is
      procedure Foo is
         Ptr : access P;  -- here P denotes the type P
      begin
         Ptr := P'Access; -- here P denotes the "this" instance of P
      end;
   end P;

The compiler complains that 'Access cannot be applied to a type, which is in
conflict with AARM 9.4-21/2.


-- 
           Summary: Protected type cannot have access taken from its body.
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: prog at msobczak dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36777

Reply via email to