-- node as Expr, since there is no Expression and we need a Sloc for the
-- error message.
- procedure Resolve_Iterated_Component_Association
+ function Resolve_Iterated_Component_Association
(N : Node_Id;
- Index_Typ : Entity_Id);
- -- For AI12-061
+ Index_Typ : Entity_Id) return Boolean;
+ -- For AI12-061: resolves iterated component association N of Index_Typ.
+ -- Returns False if resolution fails.
function Subtract (Val : Uint; To : Node_Id) return Node_Id;
-- Creates a new expression node where Val is subtracted to expression
-- Resolve_Iterated_Component_Association --
--------------------------------------------
- procedure Resolve_Iterated_Component_Association
+ function Resolve_Iterated_Component_Association
(N : Node_Id;
- Index_Typ : Entity_Id)
+ Index_Typ : Entity_Id) return Boolean
is
Loc : constant Source_Ptr := Sloc (N);
Id : constant Entity_Id := Defining_Identifier (N);
Resolution_OK := Resolve_Aggr_Expr (Expr, Single_Elmt => False);
- if not Resolution_OK then
- return;
- end if;
-
if Operating_Mode /= Check_Semantics then
Remove_References (Expr);
declare
end if;
End_Scope;
+
+ return Resolution_OK;
end Resolve_Iterated_Component_Association;
--------------
Assoc := First (Component_Associations (N));
while Present (Assoc) loop
if Nkind (Assoc) = N_Iterated_Component_Association then
- Resolve_Iterated_Component_Association (Assoc, Index_Typ);
+ if not Resolve_Iterated_Component_Association
+ (Assoc, Index_Typ)
+ then
+ return Failure;
+ end if;
elsif Nkind (Assoc) /= N_Component_Association then
Error_Msg_N