aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_res.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/sem_res.adb')
-rw-r--r--gcc/ada/sem_res.adb251
1 files changed, 123 insertions, 128 deletions
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
index f1c0177..c1c5b3e 100644
--- a/gcc/ada/sem_res.adb
+++ b/gcc/ada/sem_res.adb
@@ -455,8 +455,8 @@ package body Sem_Res is
and then not
(Nkind (Parent (P)) = N_Subtype_Indication
and then
- Nkind_In (Parent (Parent (P)), N_Component_Definition,
- N_Subtype_Declaration)
+ Nkind (Parent (Parent (P))) in N_Component_Definition
+ | N_Subtype_Declaration
and then Paren_Count (N) = 0)
then
Error_Msg_N
@@ -580,8 +580,8 @@ package body Sem_Res is
-- Legal case is in index or discriminant constraint
- elsif Nkind_In (PN, N_Index_Or_Discriminant_Constraint,
- N_Discriminant_Association)
+ elsif Nkind (PN) in N_Index_Or_Discriminant_Constraint
+ | N_Discriminant_Association
then
if Paren_Count (N) > 0 then
Error_Msg_N
@@ -602,9 +602,8 @@ package body Sem_Res is
else
D := PN;
P := Parent (PN);
- while not Nkind_In (P, N_Component_Declaration,
- N_Subtype_Indication,
- N_Entry_Declaration)
+ while Nkind (P) not in
+ N_Component_Declaration | N_Subtype_Indication | N_Entry_Declaration
loop
D := P;
P := Parent (P);
@@ -617,8 +616,8 @@ package body Sem_Res is
-- course a double fault.
if (Nkind (P) = N_Subtype_Indication
- and then Nkind_In (Parent (P), N_Component_Definition,
- N_Derived_Type_Definition)
+ and then Nkind (Parent (P)) in N_Component_Definition
+ | N_Derived_Type_Definition
and then D = Constraint (P))
-- The constraint itself may be given by a subtype indication,
@@ -810,12 +809,12 @@ package body Sem_Res is
function Is_Conditional_Statement (N : Node_Id) return Boolean is
begin
return
- Nkind_In (N, N_And_Then,
- N_Case_Expression,
- N_Case_Statement,
- N_If_Expression,
- N_If_Statement,
- N_Or_Else);
+ Nkind (N) in N_And_Then
+ | N_Case_Expression
+ | N_Case_Statement
+ | N_If_Expression
+ | N_If_Statement
+ | N_Or_Else;
end Is_Conditional_Statement;
-------------------------------
@@ -841,7 +840,7 @@ package body Sem_Res is
begin
return
Nkind (HSS) = N_Handled_Sequence_Of_Statements
- and then Nkind_In (Parent (HSS), N_Entry_Body, N_Subprogram_Body)
+ and then Nkind (Parent (HSS)) in N_Entry_Body | N_Subprogram_Body
and then Is_List_Member (N)
and then List_Containing (N) = Statements (HSS);
end Is_Immediately_Within_Body;
@@ -1149,9 +1148,8 @@ package body Sem_Res is
-- functions, this is never a parameterless call (RM 4.1.4(6)).
if Nkind (Parent (N)) = N_Attribute_Reference
- and then Nam_In (Attribute_Name (Parent (N)), Name_Address,
- Name_Code_Address,
- Name_Access)
+ and then Attribute_Name (Parent (N))
+ in Name_Address | Name_Code_Address | Name_Access
then
return False;
end if;
@@ -1201,9 +1199,9 @@ package body Sem_Res is
and then Ekind (Entity (N)) = E_Procedure
and then not Is_Overloaded (N)
and then
- Nkind_In (Parent (N), N_Parameter_Association,
- N_Function_Call,
- N_Procedure_Call_Statement)
+ Nkind (Parent (N)) in N_Parameter_Association
+ | N_Function_Call
+ | N_Procedure_Call_Statement
then
return;
end if;
@@ -1238,8 +1236,8 @@ package body Sem_Res is
(Nkind (N) = N_Selected_Component
and then (Ekind (Entity (Selector_Name (N))) = E_Function
or else
- (Ekind_In (Entity (Selector_Name (N)), E_Entry,
- E_Procedure)
+ (Ekind (Entity (Selector_Name (N))) in
+ E_Entry | E_Procedure
and then Is_Overloaded (Selector_Name (N)))))
-- If one of the above three conditions is met, rewrite as call. Apply
@@ -1547,7 +1545,7 @@ package body Sem_Res is
elsif In_Instance then
null;
- elsif Nam_In (Op_Name, Name_Op_Multiply, Name_Op_Divide)
+ elsif Op_Name in Name_Op_Multiply | Name_Op_Divide
and then Is_Fixed_Point_Type (Etype (Act1))
and then Is_Fixed_Point_Type (Etype (Act2))
then
@@ -1559,7 +1557,7 @@ package body Sem_Res is
-- available.
elsif Ada_Version >= Ada_2005
- and then Nam_In (Op_Name, Name_Op_Eq, Name_Op_Ne)
+ and then Op_Name in Name_Op_Eq | Name_Op_Ne
and then (Is_Anonymous_Access_Type (Etype (Act1))
or else Is_Anonymous_Access_Type (Etype (Act2)))
then
@@ -1670,7 +1668,7 @@ package body Sem_Res is
and then not In_Instance
then
if Is_Fixed_Point_Type (Typ)
- and then Nam_In (Op_Name, Name_Op_Multiply, Name_Op_Divide)
+ and then Op_Name in Name_Op_Multiply | Name_Op_Divide
then
-- Already checked above
@@ -1707,7 +1705,7 @@ package body Sem_Res is
-- the equality node will not resolve any remaining ambiguity, and it
-- assumes that the first operand is not overloaded.
- if Nam_In (Op_Name, Name_Op_Eq, Name_Op_Ne)
+ if Op_Name in Name_Op_Eq | Name_Op_Ne
and then Ekind (Func) = E_Function
and then Is_Overloaded (Act1)
then
@@ -2162,9 +2160,9 @@ package body Sem_Res is
-- access-to-subprogram type.
if Nkind (N) = N_Attribute_Reference
- and then Nam_In (Attribute_Name (N), Name_Access,
- Name_Unrestricted_Access,
- Name_Unchecked_Access)
+ and then Attribute_Name (N) in Name_Access
+ | Name_Unrestricted_Access
+ | Name_Unchecked_Access
and then Comes_From_Source (N)
and then Is_Entity_Name (Prefix (N))
and then Is_Subprogram (Entity (Prefix (N)))
@@ -2582,10 +2580,10 @@ package body Sem_Res is
Set_Entity (N, Seen);
Generate_Reference (Seen, N);
- elsif Nkind_In (N, N_Case_Expression,
- N_Character_Literal,
- N_Delta_Aggregate,
- N_If_Expression)
+ elsif Nkind (N) in N_Case_Expression
+ | N_Character_Literal
+ | N_Delta_Aggregate
+ | N_If_Expression
then
Set_Etype (N, Expr_Type);
@@ -2651,15 +2649,15 @@ package body Sem_Res is
-- with a name that is an explicit dereference, there is
-- nothing to be done at this point.
- elsif Nkind_In (N, N_Attribute_Reference,
- N_And_Then,
- N_Explicit_Dereference,
- N_Identifier,
- N_Indexed_Component,
- N_Or_Else,
- N_Range,
- N_Selected_Component,
- N_Slice)
+ elsif Nkind (N) in N_Attribute_Reference
+ | N_And_Then
+ | N_Explicit_Dereference
+ | N_Identifier
+ | N_Indexed_Component
+ | N_Or_Else
+ | N_Range
+ | N_Selected_Component
+ | N_Slice
or else Nkind (Name (N)) = N_Explicit_Dereference
then
null;
@@ -4546,7 +4544,7 @@ package body Sem_Res is
-- Apply appropriate constraint/predicate checks for IN [OUT] case
- if Ekind_In (F, E_In_Parameter, E_In_Out_Parameter) then
+ if Ekind (F) in E_In_Parameter | E_In_Out_Parameter then
-- Apply predicate tests except in certain special cases. Note
-- that it might be more consistent to apply these only when
@@ -4628,7 +4626,7 @@ package body Sem_Res is
-- Checks for OUT parameters and IN OUT parameters
- if Ekind_In (F, E_Out_Parameter, E_In_Out_Parameter) then
+ if Ekind (F) in E_Out_Parameter | E_In_Out_Parameter then
-- If there is a type conversion, make sure the return value
-- meets the constraints of the variable before the conversion.
@@ -4947,7 +4945,7 @@ package body Sem_Res is
if Comes_From_Source (Nam)
and then Is_Ghost_Entity (Nam)
- and then Ekind_In (F, E_In_Out_Parameter, E_Out_Parameter)
+ and then Ekind (F) in E_In_Out_Parameter | E_Out_Parameter
and then Is_Entity_Name (A)
and then Present (Entity (A))
and then not Is_Ghost_Entity (Entity (A))
@@ -5234,7 +5232,7 @@ package body Sem_Res is
Aggr := Original_Node (Expression (E));
if Has_Discriminants (Subtyp)
- and then Nkind_In (Aggr, N_Aggregate, N_Extension_Aggregate)
+ and then Nkind (Aggr) in N_Aggregate | N_Extension_Aggregate
then
Discrim := First_Discriminant (Base_Type (Subtyp));
@@ -5591,18 +5589,18 @@ package body Sem_Res is
-- N is the expression after "delta" in a fixed_point_definition;
-- see RM-3.5.9(6):
- return Nkind_In (Parent (N), N_Ordinary_Fixed_Point_Definition,
- N_Decimal_Fixed_Point_Definition,
+ return Nkind (Parent (N)) in N_Ordinary_Fixed_Point_Definition
+ | N_Decimal_Fixed_Point_Definition
-- N is one of the bounds in a real_range_specification;
-- see RM-3.5.7(5):
- N_Real_Range_Specification,
+ | N_Real_Range_Specification
-- N is the expression of a delta_constraint;
-- see RM-J.3(3):
- N_Delta_Constraint);
+ | N_Delta_Constraint;
end Expected_Type_Is_Any_Real;
-----------------------------
@@ -5684,7 +5682,7 @@ package body Sem_Res is
-- a conversion will be applied to each operand, so resolve it
-- with its own type.
- if Nkind_In (Parent (N), N_Op_Divide, N_Op_Multiply) then
+ if Nkind (Parent (N)) in N_Op_Divide | N_Op_Multiply then
Resolve (N);
else
@@ -5772,7 +5770,7 @@ package body Sem_Res is
-- involving a fixed-point operand) the conditional expression must
-- resolve to a unique visible fixed_point type, normally Duration.
- elsif Nkind_In (N, N_Case_Expression, N_If_Expression)
+ elsif Nkind (N) in N_Case_Expression | N_If_Expression
and then Etype (N) = Universal_Real
and then Is_Fixed_Point_Type (B_Typ)
then
@@ -5837,7 +5835,7 @@ package body Sem_Res is
and then (Is_Integer_Or_Universal (L)
or else
Is_Integer_Or_Universal (R))))
- and then Nkind_In (N, N_Op_Multiply, N_Op_Divide)
+ and then Nkind (N) in N_Op_Multiply | N_Op_Divide
then
if TL = Universal_Integer or else TR = Universal_Integer then
Check_For_Visible_Operator (N, B_Typ);
@@ -5883,8 +5881,8 @@ package body Sem_Res is
then
if B_Typ = Universal_Fixed
and then not Expected_Type_Is_Any_Real (N)
- and then not Nkind_In (Parent (N), N_Type_Conversion,
- N_Unchecked_Type_Conversion)
+ and then Nkind (Parent (N)) not in
+ N_Type_Conversion | N_Unchecked_Type_Conversion
then
Error_Msg_N ("type cannot be determined from context!", N);
Error_Msg_N ("\explicit conversion to result type required", N);
@@ -5895,9 +5893,8 @@ package body Sem_Res is
else
if Ada_Version = Ada_83
and then Etype (N) = Universal_Fixed
- and then not
- Nkind_In (Parent (N), N_Type_Conversion,
- N_Unchecked_Type_Conversion)
+ and then Nkind (Parent (N)) not in
+ N_Type_Conversion | N_Unchecked_Type_Conversion
then
Error_Msg_N
("(Ada 83) fixed-point operation needs explicit "
@@ -5985,7 +5982,7 @@ package body Sem_Res is
-- Give warning if explicit division by zero
- if Nkind_In (N, N_Op_Divide, N_Op_Rem, N_Op_Mod)
+ if Nkind (N) in N_Op_Divide | N_Op_Rem | N_Op_Mod
and then not Division_Checks_Suppressed (Etype (N))
then
Rop := Right_Opnd (N);
@@ -6066,7 +6063,7 @@ package body Sem_Res is
-- if both operands can be negative.
if Restriction_Check_Required (No_Implicit_Conditionals)
- and then Nkind_In (N, N_Op_Rem, N_Op_Mod)
+ and then Nkind (N) in N_Op_Rem | N_Op_Mod
then
declare
Lo : Uint;
@@ -6216,7 +6213,7 @@ package body Sem_Res is
-- operations use the same circuitry because the name in the call
-- can be an arbitrary expression with special resolution rules.
- elsif Nkind_In (Subp, N_Selected_Component, N_Indexed_Component)
+ elsif Nkind (Subp) in N_Selected_Component | N_Indexed_Component
or else (Is_Entity_Name (Subp) and then Is_Entry (Entity (Subp)))
then
Resolve_Entry_Call (N, Typ);
@@ -6647,8 +6644,8 @@ package body Sem_Res is
begin
P := Prev (N);
while Present (P) loop
- if not Nkind_In (P, N_Assignment_Statement,
- N_Raise_Constraint_Error)
+ if Nkind (P) not in N_Assignment_Statement
+ | N_Raise_Constraint_Error
then
exit Scope_Loop;
end if;
@@ -6765,7 +6762,7 @@ package body Sem_Res is
-- secondary stack (or any other one).
elsif Expander_Active
- and then Ekind_In (Nam, E_Function, E_Subprogram_Type)
+ and then Ekind (Nam) in E_Function | E_Subprogram_Type
and then Requires_Transient_Scope (Etype (Nam))
and then not Is_Ignored_Ghost_Entity (Nam)
then
@@ -6864,7 +6861,7 @@ package body Sem_Res is
F := First_Formal (Nam);
A := First_Actual (N);
while Present (F) and then Present (A) loop
- if Ekind_In (F, E_Out_Parameter, E_In_Out_Parameter)
+ if Ekind (F) in E_Out_Parameter | E_In_Out_Parameter
and then Warn_On_Modified_As_Out_Parameter (F)
and then Is_Entity_Name (A)
and then Present (Entity (A))
@@ -7579,8 +7576,8 @@ package body Sem_Res is
Expr : Node_Id) return Boolean
is
begin
- if Nkind_In (Context, N_Assignment_Statement,
- N_Object_Declaration)
+ if Nkind (Context) in
+ N_Assignment_Statement | N_Object_Declaration
and then Expression (Context) = Expr
then
return True;
@@ -7588,15 +7585,15 @@ package body Sem_Res is
-- Check whether a construct that yields a name is the expression of
-- an assignment statement or an object declaration.
- elsif (Nkind_In (Context, N_Attribute_Reference,
- N_Explicit_Dereference,
- N_Indexed_Component,
- N_Selected_Component,
- N_Slice)
+ elsif (Nkind (Context) in N_Attribute_Reference
+ | N_Explicit_Dereference
+ | N_Indexed_Component
+ | N_Selected_Component
+ | N_Slice
and then Prefix (Context) = Expr)
or else
- (Nkind_In (Context, N_Type_Conversion,
- N_Unchecked_Type_Conversion)
+ (Nkind (Context) in N_Type_Conversion
+ | N_Unchecked_Type_Conversion
and then Expression (Context) = Expr)
then
return
@@ -8460,13 +8457,11 @@ package body Sem_Res is
S : Entity_Id;
begin
- if Ekind_In (Etype (R), E_Allocator_Type,
- E_Access_Attribute_Type)
+ if Ekind (Etype (R)) in E_Allocator_Type | E_Access_Attribute_Type
then
Acc := Designated_Type (Etype (R));
- elsif Ekind_In (Etype (L), E_Allocator_Type,
- E_Access_Attribute_Type)
+ elsif Ekind (Etype (L)) in E_Allocator_Type | E_Access_Attribute_Type
then
Acc := Designated_Type (Etype (L));
else
@@ -8519,7 +8514,7 @@ package body Sem_Res is
return;
elsif T = Any_Access
- or else Ekind_In (T, E_Allocator_Type, E_Access_Attribute_Type)
+ or else Ekind (T) in E_Allocator_Type | E_Access_Attribute_Type
then
T := Find_Unique_Access_Type;
@@ -8660,8 +8655,8 @@ package body Sem_Res is
if Expander_Active
and then
- (Ekind_In (T, E_Anonymous_Access_Type,
- E_Anonymous_Access_Subprogram_Type)
+ (Ekind (T) in E_Anonymous_Access_Type
+ | E_Anonymous_Access_Subprogram_Type
or else Is_Private_Type (T))
then
if Etype (L) /= T then
@@ -9258,7 +9253,7 @@ package body Sem_Res is
Res : Node_Id;
begin
- if Nkind_In (Opnd, N_Integer_Literal, N_Real_Literal) then
+ if Nkind (Opnd) in N_Integer_Literal | N_Real_Literal then
Res :=
Make_Qualified_Expression (Loc,
Subtype_Mark => New_Occurrence_Of (Btyp, Loc),
@@ -9451,7 +9446,7 @@ package body Sem_Res is
if Short_Circuit_And_Or
and then B_Typ = Standard_Boolean
- and then Nkind_In (N, N_Op_And, N_Op_Or)
+ and then Nkind (N) in N_Op_And | N_Op_Or
then
-- Mark the corresponding putative SCO operator as truly a logical
-- (and short-circuit) operator.
@@ -9584,9 +9579,9 @@ package body Sem_Res is
Alt := First (Alternatives (N));
while Present (Alt) loop
if Is_OK_Static_Expression (Alt)
- and then (Nkind_In (Alt, N_Integer_Literal,
- N_Character_Literal)
- or else Nkind (Alt) in N_Has_Entity)
+ and then Nkind (Alt) in N_Integer_Literal
+ | N_Character_Literal
+ | N_Has_Entity
then
Nalts := Nalts + 1;
Alts (Nalts) := (Alt, Expr_Value (Alt));
@@ -10239,7 +10234,7 @@ package body Sem_Res is
begin
if B_Typ = Standard_Boolean
- and then Nkind_In (Opnd, N_Op_Eq, N_Op_Ne)
+ and then Nkind (Opnd) in N_Op_Eq | N_Op_Ne
and then Is_Overloaded (Opnd)
then
Resolve_Equality_Op (Opnd, B_Typ);
@@ -11257,10 +11252,10 @@ package body Sem_Res is
elsif Nkind (Parent (N)) = N_Op_Concat
and then not Need_Check
- and then not Nkind_In (Original_Node (N), N_Character_Literal,
- N_Attribute_Reference,
- N_Qualified_Expression,
- N_Type_Conversion)
+ and then Nkind (Original_Node (N)) not in N_Character_Literal
+ | N_Attribute_Reference
+ | N_Qualified_Expression
+ | N_Type_Conversion
then
Subtype_Id := Typ;
@@ -11546,14 +11541,14 @@ package body Sem_Res is
-- precision.
if Is_Fixed_Point_Type (Typ)
- and then Nkind_In (Operand, N_Op_Divide, N_Op_Multiply)
+ and then Nkind (Operand) in N_Op_Divide | N_Op_Multiply
and then Etype (Left_Opnd (Operand)) = Any_Fixed
and then Etype (Right_Opnd (Operand)) = Any_Fixed
then
Set_Etype (Operand, Universal_Real);
elsif Is_Numeric_Type (Typ)
- and then Nkind_In (Operand, N_Op_Multiply, N_Op_Divide)
+ and then Nkind (Operand) in N_Op_Multiply | N_Op_Divide
and then (Etype (Right_Opnd (Operand)) = Universal_Real
or else
Etype (Left_Opnd (Operand)) = Universal_Real)
@@ -11715,11 +11710,11 @@ package body Sem_Res is
-- newer language version.
elsif Nkind (Orig_N) = N_Qualified_Expression
- and then Nkind_In (Parent (N), N_Attribute_Reference,
- N_Indexed_Component,
- N_Selected_Component,
- N_Slice,
- N_Explicit_Dereference)
+ and then Nkind (Parent (N)) in N_Attribute_Reference
+ | N_Indexed_Component
+ | N_Selected_Component
+ | N_Slice
+ | N_Explicit_Dereference
then
null;
@@ -11849,7 +11844,7 @@ package body Sem_Res is
-- Handle subtypes
- if Ekind_In (Opnd, E_Protected_Subtype, E_Task_Subtype) then
+ if Ekind (Opnd) in E_Protected_Subtype | E_Task_Subtype then
Opnd := Etype (Opnd);
end if;
@@ -12007,7 +12002,7 @@ package body Sem_Res is
-- mod. These are the cases where the grouping can affect results.
if Paren_Count (Rorig) = 0
- and then Nkind_In (Rorig, N_Op_Mod, N_Op_Multiply, N_Op_Divide)
+ and then Nkind (Rorig) in N_Op_Mod | N_Op_Multiply | N_Op_Divide
then
-- For mod, we always give the warning, since the value is
-- affected by the parenthesization (e.g. (-5) mod 315 /=
@@ -12089,7 +12084,7 @@ package body Sem_Res is
-- overflow is impossible (divisor > 1) or we have a case of
-- division by zero in any case.
- if Nkind_In (Rorig, N_Op_Divide, N_Op_Rem)
+ if Nkind (Rorig) in N_Op_Divide | N_Op_Rem
and then Compile_Time_Known_Value (Right_Opnd (Rorig))
and then UI_Abs (Expr_Value (Right_Opnd (Rorig))) /= 1
then
@@ -12567,9 +12562,9 @@ package body Sem_Res is
or else (Is_Fixed_Point_Type (Target_Typ)
and then Conversion_OK (N)))
and then Nkind (Operand) = N_Attribute_Reference
- and then Nam_In (Attribute_Name (Operand), Name_Rounding,
- Name_Machine_Rounding,
- Name_Truncation)
+ and then Attribute_Name (Operand) in Name_Rounding
+ | Name_Machine_Rounding
+ | Name_Truncation
then
declare
Truncate : constant Boolean :=
@@ -12702,7 +12697,7 @@ package body Sem_Res is
-- When the context is a type conversion, issue the warning on the
-- expression of the conversion because it is the actual operation.
- if Nkind_In (N, N_Type_Conversion, N_Unchecked_Type_Conversion) then
+ if Nkind (N) in N_Type_Conversion | N_Unchecked_Type_Conversion then
ErrN := Expression (N);
else
ErrN := N;
@@ -12923,11 +12918,10 @@ package body Sem_Res is
-- <prefix>.all.Access_Discrim.all.Access_Discrim case,
-- where the correct result depends on <prefix>.
- return Nkind_In (Associated_Node,
- N_Procedure_Specification, -- access parameter
- N_Function_Specification, -- access parameter
- N_Object_Declaration -- saooaaat
- )
+ return Nkind (Associated_Node) in
+ N_Procedure_Specification | -- access parameter
+ N_Function_Specification | -- access parameter
+ N_Object_Declaration -- saooaaat
or else Is_Discrim_Of_Bad_Access_Conversion_Argument (Deref_Prefix);
end Is_Discrim_Of_Bad_Access_Conversion_Argument;
@@ -13001,9 +12995,9 @@ package body Sem_Res is
-- checks that must be applied to such conversions to prevent
-- out-of-scope references.
- elsif Ekind_In
- (Target_Comp_Base, E_Anonymous_Access_Type,
- E_Anonymous_Access_Subprogram_Type)
+ elsif Ekind (Target_Comp_Base) in
+ E_Anonymous_Access_Type
+ | E_Anonymous_Access_Subprogram_Type
and then Ekind (Opnd_Comp_Base) = Ekind (Target_Comp_Base)
and then
Subtypes_Statically_Match (Target_Comp_Type, Opnd_Comp_Type)
@@ -13312,8 +13306,8 @@ package body Sem_Res is
-- interface type.
elsif Is_Access_Type (Opnd_Type)
- and then Ekind_In (Target_Type, E_General_Access_Type,
- E_Anonymous_Access_Type)
+ and then Ekind (Target_Type) in
+ E_General_Access_Type | E_Anonymous_Access_Type
and then Is_Interface (Directly_Designated_Type (Target_Type))
then
-- Check the static accessibility rule of 4.6(17). Note that the
@@ -13393,7 +13387,7 @@ package body Sem_Res is
if Is_Entity_Name (Operand)
and then not Is_Local_Anonymous_Access (Opnd_Type)
and then
- Ekind_In (Entity (Operand), E_In_Parameter, E_Constant)
+ Ekind (Entity (Operand)) in E_In_Parameter | E_Constant
and then Present (Discriminal_Link (Entity (Operand)))
then
Conversion_Error_N
@@ -13408,14 +13402,15 @@ package body Sem_Res is
-- General and anonymous access types
- elsif Ekind_In (Target_Type, E_General_Access_Type,
- E_Anonymous_Access_Type)
+ elsif Ekind (Target_Type) in
+ E_General_Access_Type | E_Anonymous_Access_Type
and then
Conversion_Check
(Is_Access_Type (Opnd_Type)
- and then not
- Ekind_In (Opnd_Type, E_Access_Subprogram_Type,
- E_Access_Protected_Subprogram_Type),
+ and then
+ Ekind (Opnd_Type) not in
+ E_Access_Subprogram_Type |
+ E_Access_Protected_Subprogram_Type,
"must be an access-to-object type")
then
if Is_Access_Constant (Opnd_Type)
@@ -13471,10 +13466,10 @@ package body Sem_Res is
-- as universal_access "=".
elsif not Is_Local_Anonymous_Access (Opnd_Type)
- and then Nkind_In (Associated_Node_For_Itype (Opnd_Type),
- N_Function_Specification,
- N_Procedure_Specification)
- and then not Nkind_In (Parent (N), N_Op_Eq, N_Op_Ne)
+ and then Nkind (Associated_Node_For_Itype (Opnd_Type)) in
+ N_Function_Specification |
+ N_Procedure_Specification
+ and then Nkind (Parent (N)) not in N_Op_Eq | N_Op_Ne
then
Conversion_Error_N
("implicit conversion of anonymous access parameter "
@@ -13588,7 +13583,7 @@ package body Sem_Res is
if Is_Entity_Name (Operand)
and then
- Ekind_In (Entity (Operand), E_In_Parameter, E_Constant)
+ Ekind (Entity (Operand)) in E_In_Parameter | E_Constant
and then Present (Discriminal_Link (Entity (Operand)))
then
Conversion_Error_N