return;
end if;
- if Has_Discriminants (U_Type)
- and then Present
- (Discriminant_Default_Value (First_Discriminant (U_Type)))
- then
+ if Has_Defaulted_Discriminants (U_Type) then
Build_Mutable_Record_Read_Procedure
(Loc, Full_Base (U_Type), Decl, Pname);
else
end if;
end if;
- if Has_Discriminants (U_Type)
- and then Present
- (Discriminant_Default_Value (First_Discriminant (U_Type)))
- then
+ if Has_Defaulted_Discriminants (U_Type) then
Build_Mutable_Record_Write_Procedure
(Loc, Full_Base (U_Type), Decl, Pname);
else
begin
return Scope (Base_Index) = Standard_Standard
and then Base_Index = Base_Type (Standard_Integer)
- and then Has_Discriminants (Conctyp)
- and then
- Present (Discriminant_Default_Value (First_Discriminant (Conctyp)))
+ and then Has_Defaulted_Discriminants (Conctyp)
and then
(Denotes_Discriminant (Lo, True)
or else
(Has_Unknown_Discriminants (T)
or else
(not Has_Discriminants (T)
- and then Has_Discriminants (Full_View (T))
- and then Present (Discriminant_Default_Value
- (First_Discriminant (Full_View (T))))))
+ and then Has_Defaulted_Discriminants (Full_View (T))))
then
T := Full_View (T);
E := Full_View (E);
if not Has_Unknown_Discriminants (Priv_T)
and then not Has_Discriminants (Priv_T)
- and then Has_Discriminants (Full_T)
- and then
- Present (Discriminant_Default_Value (First_Discriminant (Full_T)))
+ and then Has_Defaulted_Discriminants (Full_T)
then
Set_Has_Constrained_Partial_View (Full_T);
Set_Has_Constrained_Partial_View (Priv_T);
Type_Id := Entity (E);
if Is_Tagged_Type (Type_Id)
- and then Has_Discriminants (Type_Id)
+ and then Has_Defaulted_Discriminants (Type_Id)
and then not Is_Constrained (Type_Id)
- and then
- Present
- (Discriminant_Default_Value
- (First_Discriminant (Type_Id)))
then
declare
Constr : constant List_Id := New_List;
Discr : Entity_Id := First_Discriminant (Type_Id);
begin
- if Present (Discriminant_Default_Value (Discr)) then
- while Present (Discr) loop
- Append (Discriminant_Default_Value (Discr), Constr);
- Next_Discriminant (Discr);
- end loop;
+ while Present (Discr) loop
+ Append (Discriminant_Default_Value (Discr), Constr);
+ Next_Discriminant (Discr);
+ end loop;
- Rewrite (E,
- Make_Subtype_Indication (Loc,
- Subtype_Mark => New_Occurrence_Of (Type_Id, Loc),
- Constraint =>
- Make_Index_Or_Discriminant_Constraint (Loc,
- Constraints => Constr)));
- end if;
+ Rewrite (E,
+ Make_Subtype_Indication (Loc,
+ Subtype_Mark => New_Occurrence_Of (Type_Id, Loc),
+ Constraint =>
+ Make_Index_Or_Discriminant_Constraint (Loc,
+ Constraints => Constr)));
end;
end if;
end if;
function Has_Defaulted_Discriminants (Typ : Entity_Id) return Boolean is
begin
return Has_Discriminants (Typ)
- and then Present (First_Discriminant (Typ))
and then Present (Discriminant_Default_Value
(First_Discriminant (Typ)));
end Has_Defaulted_Discriminants;
-- Record types
elsif Is_Record_Type (Typ) then
- if Has_Discriminants (Typ)
- and then
- Present (Discriminant_Default_Value (First_Discriminant (Typ)))
+ if Has_Defaulted_Discriminants (Typ)
and then Is_Fully_Initialized_Variant (Typ)
then
return True;