Commit 43b60e57 by Eric Botcazou Committed by Eric Botcazou

decl.c (Gigi_Equivalent_Type): New case.

	* gcc-interface/decl.c (Gigi_Equivalent_Type) <E_Array_Subtype>: New
	case.  Return the base type if the subtype is not constrained.

From-SVN: r276865
parent 104099b8
2019-10-11 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (Gigi_Equivalent_Type) <E_Array_Subtype>: New
case. Return the base type if the subtype is not constrained.
2019-10-11 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Named_{Integer|Real}>:
New case to deal with the definition of named numbers.
<E_Variable>: Minor tweaks. Set DECL_IGNORED_P on the CONST_DECL
......
......@@ -5026,6 +5026,11 @@ Gigi_Equivalent_Type (Entity_Id gnat_entity)
gnat_equiv = Etype (gnat_entity);
break;
case E_Array_Subtype:
if (!Is_Constrained (gnat_entity))
gnat_equiv = Etype (gnat_entity);
break;
case E_Class_Wide_Type:
gnat_equiv = Root_Type (gnat_entity);
break;
......
2019-10-11 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/array38.adb: New test.
* gnat.dg/array38_pkg.ad[sb]: New helper.
2019-10-11 Jakub Jelinek <jakub@redhat.com>
PR c++/91987
......
-- { dg-do compile }
with Array38_Pkg; use Array38_Pkg;
procedure Array38 is
function My_F is new F (Index, Byte, Bytes, Integer);
begin
null;
end;
package body Array38_Pkg is
function F (Data : Array_Type) return Value_Type is
begin
return Value_Type'First;
end;
end Array38_Pkg;
package Array38_Pkg is
type Byte is mod 2**8;
type Length is new Natural;
subtype Index is Length range 1 .. Length'Last;
type Bytes is array (Index range <>) of Byte with
Predicate => Bytes'Length > 0;
generic
type Index_Type is (<>);
type Element_Type is (<>);
type Array_Type is array (Index_Type range <>) of Element_Type;
type Value_Type is (<>);
function F (Data : Array_Type) return Value_Type;
end Array38_Pkg;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment