if (Nkind (D) = N_Full_Type_Declaration and then Is_Array_Type (E))
or else
(Nkind (D) = N_Object_Declaration
- and then (Ekind (E) = E_Constant
- or else
- Ekind (E) = E_Variable)
+ and then Ekind_In (E, E_Constant, E_Variable)
and then Nkind (Object_Definition (D)) =
N_Constrained_Array_Definition)
or else
-- pragma Complex_Representation ([Entity =>] LOCAL_NAME);
when Pragma_Complex_Representation => Complex_Representation : declare
- E_Id : Entity_Id;
+ E_Id : Node_Id;
E : Entity_Id;
Ent : Entity_Id;
-- effectively volatile.
elsif Is_Array_Type (Id) then
- declare
- Anc : Entity_Id := Base_Type (Id);
- begin
- if Is_Private_Type (Anc) then
- Anc := Full_View (Anc);
- end if;
+ if Has_Volatile_Components (Id) then
+ return True;
+ else
+ declare
+ Anc : Entity_Id := Base_Type (Id);
+ begin
+ if Is_Private_Type (Anc) then
+ Anc := Full_View (Anc);
+ end if;
- -- Test for presence of ancestor, as the full view of a private
- -- type may be missing in case of error.
+ -- Test for presence of ancestor, as the full view of a
+ -- private type may be missing in case of error.
- return
- Has_Volatile_Components (Id)
- or else
- (Present (Anc)
- and then Is_Effectively_Volatile (Component_Type (Anc)));
- end;
+ return
+ Present (Anc)
+ and then Is_Effectively_Volatile (Component_Type (Anc));
+ end;
+ end if;
-- A protected type is always volatile