Commit e3d6bccc by Hristian Kirtchev Committed by Arnaud Charlet

sem_ch3.adb, [...]: Minor reformatting.

2015-10-26  Hristian Kirtchev  <kirtchev@adacore.com>

	* sem_ch3.adb, sem_util.adb: Minor reformatting.

From-SVN: r229354
parent 97561cdc
2015-10-26 Hristian Kirtchev <kirtchev@adacore.com>
* sem_ch3.adb, sem_util.adb: Minor reformatting.
2015-10-26 Javier Miranda <miranda@adacore.com> 2015-10-26 Javier Miranda <miranda@adacore.com>
* exp_aggr.adb (Aggr_Assignment_OK_For_Backend): Return False when * exp_aggr.adb (Aggr_Assignment_OK_For_Backend): Return False when
......
...@@ -3276,7 +3276,7 @@ package body Sem_Ch3 is ...@@ -3276,7 +3276,7 @@ package body Sem_Ch3 is
function Count_Tasks (T : Entity_Id) return Uint; function Count_Tasks (T : Entity_Id) return Uint;
-- This function is called when a non-generic library level object of a -- 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 -- 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 -- 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 -- or a variant record type is encountered, Check_Restriction is called
-- indicating the count is unknown. -- indicating the count is unknown.
...@@ -5241,15 +5241,14 @@ package body Sem_Ch3 is ...@@ -5241,15 +5241,14 @@ package body Sem_Ch3 is
Cstr : constant Node_Id := Constraint (Subtype_Indication (N)); Cstr : constant Node_Id := Constraint (Subtype_Indication (N));
begin begin
if Nkind (Cstr) = N_Index_Or_Discriminant_Constraint if Nkind (Cstr) = N_Index_Or_Discriminant_Constraint
and then not (Is_Internal (Defining_Identifier (N)) and then not (Is_Internal (Id)
and then Is_TSS (Scope (Defining_Identifier (N)), and then Is_TSS (Scope (Id),
TSS_Composite_Equality)) TSS_Composite_Equality))
and then not Within_Init_Proc and then not Within_Init_Proc
and then not All_Composite_Constraints_Static (Cstr)
then then
if not All_Composite_Constraints_Static (Cstr) then
Check_Restriction (No_Dynamic_Sized_Objects, Cstr); Check_Restriction (No_Dynamic_Sized_Objects, Cstr);
end if; end if;
end if;
end; end;
end if; end if;
end Analyze_Subtype_Declaration; end Analyze_Subtype_Declaration;
......
...@@ -452,24 +452,30 @@ package body Sem_Util is ...@@ -452,24 +452,30 @@ package body Sem_Util is
and then Present (Entity (Constr)) and then Present (Entity (Constr))
then then
if Is_Type (Entity (Constr)) then if Is_Type (Entity (Constr)) then
return not Is_Discrete_Type (Entity (Constr)) return
not Is_Discrete_Type (Entity (Constr))
or else Is_OK_Static_Subtype (Entity (Constr)); or else Is_OK_Static_Subtype (Entity (Constr));
end if; end if;
elsif Nkind (Constr) = N_Range then elsif Nkind (Constr) = N_Range then
return Is_OK_Static_Expression (Low_Bound (Constr)) return
and then Is_OK_Static_Expression (High_Bound (Constr)); Is_OK_Static_Expression (Low_Bound (Constr))
and then
Is_OK_Static_Expression (High_Bound (Constr));
elsif Nkind (Constr) = N_Attribute_Reference elsif Nkind (Constr) = N_Attribute_Reference
and then Attribute_Name (Constr) = Name_Range and then Attribute_Name (Constr) = Name_Range
then then
return Is_OK_Static_Expression return
Is_OK_Static_Expression
(Type_Low_Bound (Etype (Prefix (Constr)))) (Type_Low_Bound (Etype (Prefix (Constr))))
and then Is_OK_Static_Expression and then
Is_OK_Static_Expression
(Type_High_Bound (Etype (Prefix (Constr)))); (Type_High_Bound (Etype (Prefix (Constr))));
end if; end if;
return not Present (Etype (Constr)) -- previous error return
not Present (Etype (Constr)) -- previous error
or else not Is_Discrete_Type (Etype (Constr)) or else not Is_Discrete_Type (Etype (Constr))
or else Is_OK_Static_Expression (Constr); or else Is_OK_Static_Expression (Constr);
...@@ -477,8 +483,8 @@ package body Sem_Util is ...@@ -477,8 +483,8 @@ package body Sem_Util is
return All_Composite_Constraints_Static (Expression (Constr)); return All_Composite_Constraints_Static (Expression (Constr));
when N_Range_Constraint => when N_Range_Constraint =>
return All_Composite_Constraints_Static return
(Range_Expression (Constr)); All_Composite_Constraints_Static (Range_Expression (Constr));
when N_Index_Or_Discriminant_Constraint => when N_Index_Or_Discriminant_Constraint =>
declare declare
...@@ -497,8 +503,10 @@ package body Sem_Util is ...@@ -497,8 +503,10 @@ package body Sem_Util is
return True; return True;
when N_Subtype_Indication => when N_Subtype_Indication =>
return All_Composite_Constraints_Static (Subtype_Mark (Constr)) return
and then All_Composite_Constraints_Static (Constraint (Constr)); All_Composite_Constraints_Static (Subtype_Mark (Constr))
and then
All_Composite_Constraints_Static (Constraint (Constr));
when others => when others =>
raise Program_Error; raise Program_Error;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment