OSDN Git Service

* targhooks.c (default_stack_protect_guard): Avoid sharing RTL
[pf3gnuchains/gcc-fork.git] / gcc / ada / exp_ch3.adb
index 17e6395..9420558 100644 (file)
@@ -5715,9 +5715,13 @@ package body Exp_Ch3 is
          if Has_Task (Comp_Typ) then
             Set_Has_Task (Def_Id);
 
-         elsif Has_Controlled_Component (Comp_Typ)
-           or else (Chars (Comp) /= Name_uParent
-                     and then Is_Controlled (Comp_Typ))
+         --  Do not set Has_Controlled_Component on a class-wide equivalent
+         --  type. See Make_CW_Equivalent_Type.
+
+         elsif not Is_Class_Wide_Equivalent_Type (Def_Id)
+           and then (Has_Controlled_Component (Comp_Typ)
+                      or else (Chars (Comp) /= Name_uParent
+                                and then Is_Controlled (Comp_Typ)))
          then
             Set_Has_Controlled_Component (Def_Id);
 
@@ -8104,8 +8108,7 @@ package body Exp_Ch3 is
       elsif Restriction_Active (No_Finalization) then
          null;
 
-      --  We skip these for CIL Value types, where finalization is not
-      --  available
+      --  Skip these for CIL Value types, where finalization is not available
 
       elsif Is_Value_Type (Tag_Typ) then
          null;