2012-07-03 Eric Botcazou <ebotcazou@adacore.com>
+ * gcc-interface/utils2.c (build_simple_component_ref): Do not look
+ through an extension if the type contains a placeholder.
+
+2012-07-03 Eric Botcazou <ebotcazou@adacore.com>
+
* exp_disp.adb (Expand_Dispatching_Call): Propagate the convention on
the designated subprogram type and also set Is_Dispatch_Table_Entity.
(Expand_Interface_Thunk): Propagate the convention on the thunk.
break;
/* Next, see if we're looking for an inherited component in an extension.
- If so, look thru the extension directly. */
+ If so, look thru the extension directly, but not if the type contains
+ a placeholder, as it might be needed for a later substitution. */
if (!new_field
&& TREE_CODE (record_variable) == VIEW_CONVERT_EXPR
&& TYPE_ALIGN_OK (record_type)
+ && !type_contains_placeholder_p (record_type)
&& TREE_CODE (TREE_TYPE (TREE_OPERAND (record_variable, 0)))
== RECORD_TYPE
&& TYPE_ALIGN_OK (TREE_TYPE (TREE_OPERAND (record_variable, 0))))
+2012-07-03 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/discr37.ad[sb]: New test.
+
2012-07-02 Jason Merrill <jason@redhat.com>
PR c++/53816
--- /dev/null
+-- { dg-do compile }
+
+package body Discr37 is
+
+ procedure Proc (A : access Child) is
+ B : Derived renames Derived (A.F(1).all);
+ C : Derived renames Derived (B.S(1).all);
+ begin
+ null;
+ end;
+
+end Discr37;
--- /dev/null
+package Discr37 is
+
+ subtype Index is Integer range 0 .. 100;
+
+ type Root;
+ type Frame_Ptr is access all Root'Class;
+
+ type Arr is array (Index range <>) of Frame_Ptr;
+
+ type Root (Level : Index) is tagged record
+ S : Arr (0 .. Level);
+ end record;
+
+ type Derived (Level : Index) is new Root (Level) with null record;
+
+ type Child is new Derived (0) with record
+ F : Arr (0 .. 100);
+ end record;
+
+ procedure Proc (A : access Child);
+
+end Discr37;