This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug ada/15915] New: Illegal program not detected, RM 13.11(15)


-- RM 13.11(15)
-- the name in a Storage_Pool clause shall denote a variable
with System.Storage_Pools;
with System.Storage_Elements;
package Test_247560 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 (x1);  -- ERROR:
                                  -- parenthesised expression, not variable
end Test_247560;


I expect an error message like this:
test_247560.ads:27:27: variable expected, found expression

But the compiler remains silent.  To be more precise, it says:
cannot generate code for file test_247560.ads (package spec)
to check package spec for errors, use -gnatc
gnatmake: "test_247560.ads" compilation error

which is unrelated to the bug.  Also:

$ gcc-3.4 -c -gnatc test_247560.ads
yields nothing.

-- 
           Summary: Illegal program not detected, RM 13.11(15)
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: ada
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ludovic dot brenta at insalien dot org
                CC: gcc-bugs at gcc dot gnu dot org


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]