2010-05-30 Eric Botcazou <ebotcazou@adacore.com>
+ * gcc-interface/decl.c (gnat_to_gnu_entity) <E_Task_Type>: Reuse the
+ TYPE_DECL of the equivalent type instead of building a new one.
+
+2010-05-30 Eric Botcazou <ebotcazou@adacore.com>
+
* gcc-interface/decl.c (gnat_to_gnu_entity): Adjust warning message.
Fix nits in comments.
* gcc-interface/misc.c (gnat_init_gcc_eh): Likewise.
case E_Task_Subtype:
case E_Protected_Type:
case E_Protected_Subtype:
+ /* Concurrent types are always transformed into their record type. */
if (type_annotate_only && No (gnat_equiv_type))
gnu_type = void_type_node;
else
- gnu_type = gnat_to_gnu_type (gnat_equiv_type);
-
+ gnu_decl = gnat_to_gnu_entity (gnat_equiv_type, NULL_TREE, 0);
maybe_present = true;
break;
2010-05-30 Eric Botcazou <ebotcazou@adacore.com>
+ * gnat.dg/prot2.ad[sb]: New test.
+ * gnat.dg/prot2_pkg1.ads: New helper.
+ * gnat.dg/prot2_pkg2.ad[sb]: Likewise.
+
+2010-05-30 Eric Botcazou <ebotcazou@adacore.com>
+
* gnat.dg/array11.adb: Adjust dg-warning directive.
* gnat.dg/object_overflow.adb: Likewise.
--- /dev/null
+-- { dg-do compile }
+
+with Prot2_Pkg1;
+with Prot2_Pkg2;
+
+package body Prot2 is
+
+ type A is array (1 .. Prot2_Pkg1.Num) of Integer;
+
+ type E is (One, Two);
+
+ type Rec (D : E := One) is record
+ case D is
+ when One => L : A;
+ when Two => null;
+ end case;
+ end record;
+
+ package My_Pkg2 is new Prot2_Pkg2 (Rec);
+
+ procedure Dummy is begin null; end;
+
+end Prot2;
--- /dev/null
+package Prot2 is
+
+ procedure Dummy;
+
+end Prot2;
--- /dev/null
+package Prot2_Pkg1 is
+
+ function Num return Natural;
+
+end Prot2_Pkg1;
--- /dev/null
+with Unchecked_Deallocation;
+
+package body Prot2_Pkg2 is
+
+ protected type Rec is
+ private
+ M : T;
+ end Rec;
+
+ protected body Rec is end;
+
+ procedure Create (B : out Id) is
+ begin
+ B := new Rec;
+ end;
+
+ procedure Delete (B : in out Id) is
+ procedure Free is new Unchecked_Deallocation(Object => Rec, Name => Id);
+ begin
+ Free (B);
+ end;
+
+end Prot2_Pkg2;
--- /dev/null
+generic
+
+ type T is private;
+
+package Prot2_Pkg2 is
+
+ type Id is private;
+
+ procedure Create (B : out Id);
+ procedure Delete (B : in out Id);
+
+private
+
+ type Rec;
+ type Id is access Rec;
+
+end Prot2_Pkg2;