function Count_Tasks (T : Entity_Id) return Uint;
-- This function is called when a non-generic library level object of a
-- task type is declared. Its function is to count the static number of
- -- tasks declared within the type (it is only called if Has_Tasks is set
+ -- tasks declared within the type (it is only called if Has_Task is set
-- for T). As a side effect, if an array of tasks with non-static bounds
-- or a variant record type is encountered, Check_Restriction is called
-- indicating the count is unknown.
Cstr : constant Node_Id := Constraint (Subtype_Indication (N));
begin
if Nkind (Cstr) = N_Index_Or_Discriminant_Constraint
- and then not (Is_Internal (Defining_Identifier (N))
- and then Is_TSS (Scope (Defining_Identifier (N)),
- TSS_Composite_Equality))
+ and then not (Is_Internal (Id)
+ and then Is_TSS (Scope (Id),
+ TSS_Composite_Equality))
and then not Within_Init_Proc
+ and then not All_Composite_Constraints_Static (Cstr)
then
- if not All_Composite_Constraints_Static (Cstr) then
- Check_Restriction (No_Dynamic_Sized_Objects, Cstr);
- end if;
+ Check_Restriction (No_Dynamic_Sized_Objects, Cstr);
end if;
end;
end if;
and then Present (Entity (Constr))
then
if Is_Type (Entity (Constr)) then
- return not Is_Discrete_Type (Entity (Constr))
- or else Is_OK_Static_Subtype (Entity (Constr));
+ return
+ not Is_Discrete_Type (Entity (Constr))
+ or else Is_OK_Static_Subtype (Entity (Constr));
end if;
elsif Nkind (Constr) = N_Range then
- return Is_OK_Static_Expression (Low_Bound (Constr))
- and then Is_OK_Static_Expression (High_Bound (Constr));
+ return
+ Is_OK_Static_Expression (Low_Bound (Constr))
+ and then
+ Is_OK_Static_Expression (High_Bound (Constr));
elsif Nkind (Constr) = N_Attribute_Reference
and then Attribute_Name (Constr) = Name_Range
then
- return Is_OK_Static_Expression
- (Type_Low_Bound (Etype (Prefix (Constr))))
- and then Is_OK_Static_Expression
+ return
+ Is_OK_Static_Expression
+ (Type_Low_Bound (Etype (Prefix (Constr))))
+ and then
+ Is_OK_Static_Expression
(Type_High_Bound (Etype (Prefix (Constr))));
end if;
- return not Present (Etype (Constr)) -- previous error
- or else not Is_Discrete_Type (Etype (Constr))
- or else Is_OK_Static_Expression (Constr);
+ return
+ not Present (Etype (Constr)) -- previous error
+ or else not Is_Discrete_Type (Etype (Constr))
+ or else Is_OK_Static_Expression (Constr);
when N_Discriminant_Association =>
return All_Composite_Constraints_Static (Expression (Constr));
when N_Range_Constraint =>
- return All_Composite_Constraints_Static
- (Range_Expression (Constr));
+ return
+ All_Composite_Constraints_Static (Range_Expression (Constr));
when N_Index_Or_Discriminant_Constraint =>
declare
return True;
when N_Subtype_Indication =>
- return All_Composite_Constraints_Static (Subtype_Mark (Constr))
- and then All_Composite_Constraints_Static (Constraint (Constr));
+ return
+ All_Composite_Constraints_Static (Subtype_Mark (Constr))
+ and then
+ All_Composite_Constraints_Static (Constraint (Constr));
when others =>
raise Program_Error;