Bug 15842 - Legal program rejected
Summary: Legal program rejected
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: ada (show other bugs)
Version: 3.4.0
: P2 normal
Target Milestone: 4.0.0
Assignee: Not yet assigned to anyone
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2004-06-06 10:17 UTC by Ludovic Brenta
Modified: 2005-07-23 22:49 UTC (History)
1 user (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 Ludovic Brenta 2004-06-06 10:17:30 UTC
with System.Storage_Pools;
with System.Storage_Elements;
package Test_247016 is
   type Storage_Pool_Type
     is new System.Storage_Pools.Root_Storage_Pool with null record;

   procedure Allocate
      (Pool                     : in out Storage_Pool_Type;
       Storage_Address          :    out System.Address;
       Size_In_Storage_Elements : in     System.Storage_Elements.Storage_Count;
       Alignment                : in     System.Storage_Elements.Storage_Count);

   procedure Deallocate
      (Pool                     : in out Storage_Pool_Type;
       Storage_Address          : in     System.Address;
       Size_In_Storage_Elements : in     System.Storage_Elements.Storage_Count;
       Alignment                : in     System.Storage_Elements.Storage_Count);

   function Storage_Size
      (Pool : in Storage_Pool_Type)
         return System.Storage_Elements.Storage_Count;

   x1: Storage_Pool_Type;

   type T1 is access integer;
   for T1'Storage_Pool use System.Storage_Pools.Root_Storage_Pool (x1);

end Test_247016;

The compiler says incorrectly:

test_247016.ads:26:48: incorrect reference to a Storage Pool
gnatmake: "test_247016.ads" compilation error
Comment 1 Andrew Pinski 2004-10-29 13:32:26 UTC
I get this on the mainline):
cannot generate code for file test_247016.ads (package spec)
to check package spec for errors, use -gnatc

(I don't know gnat/Ada that much, does that mean this code is accepted?)
Comment 2 Arnaud Charlet 2004-10-29 13:34:08 UTC
If that's the only error you are getting, and compiling the spec with -gnatc
gives no error, then indeed the problem is fixed.

Arno