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/16084] New: Illegal program not detected, RM 3.10.2(24)


-- RM 3.10.2(24)
-- X [in X'access or X'unchecked_access] shall denote an aliased
-- view of an object, including possibly the current instance (see 8.6)
-- of a limited type within its definition...
with Ada.Finalization;
package Test_248170 is
   type T1 is new Ada.Finalization.Controlled with null record;

   type T2;
   type T2_ptr is access all T2'class;

   type T2 is tagged
      record
         x1: T1;
         self: T2_ptr := T2'unchecked_access;  --ERROR: T2 not limited
      end record;

end Test_248170;



I expect an error message like this:
test_248170.ads:15:28: prefix of 'Unchecked_Access is not aliased and not the
current instance of a limited type

But the compiler says nothing.

-- 
           Summary: Illegal program not detected, RM 3.10.2(24)
           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=16084


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