This is the mail archive of the gcc-patches@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]

[Ada] Frontend crash processing access to limited-withed entity


The compiler crashes proocessing an access to a class-wide
type whose tagged type is declared in a package that is
visible through a limited-with context clause. The following
test must compile without errors.

package CMOF is end;

package CMOF.Pkg_I is
   type I is interface;
end;

limited with CMOF.Pkg_I;
package CMOF.Pkg_I_Ptr is
   type I_Access is access Pkg_I.I'Class;
end;

with CMOF.Pkg_I_Ptr; use CMOF.Pkg_I_Ptr;
package body Do_Test is
   type Rec is record
      Ptr : not null I_Access;
   end record;

   O1 : I_Access;

   procedure Do_Test is
     O2 : Rec;
   begin
     O2.Ptr := O1;
   end;
end;

package Do_Test is
   procedure Do_Test;
end;

Command: gnatmake -gnat05 do_test.adb

Tested on x86_64-pc-linux-gnu, committed on trunk

2009-06-24  Javier Miranda  <miranda@adacore.com>

	* exp_ch4.adb (Expand_N_Type_Conversion): Handle entities that are
	visible through limited-with context clauses. In addition, avoid an
	extra tag check that is not required when the class-wide
	designated types of the operand and target types are
	the same entity.
	(Tagged_Membership): Handle entities from the limited view.

Attachment: difs
Description: Text document


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