case Nkind (A) is
when N_Object_Declaration =>
+ Inspect_Deferred_Constant_Completion (A);
+
if Nkind (Object_Definition (A)) = N_Access_Definition then
Error_Msg_N
("anonymous access type not allowed in declare_expression",
("implicit label declaration for & is hidden#",
Identifier (S));
end if;
+ else
+ Inspect_Deferred_Constant_Completion (S);
end if;
Next (S);
-- Inspect_Deferred_Constant_Completion --
------------------------------------------
- procedure Inspect_Deferred_Constant_Completion (Decls : List_Id) is
- Decl : Node_Id;
-
+ procedure Inspect_Deferred_Constant_Completion (Decl : Node_Id) is
begin
- Decl := First (Decls);
- while Present (Decl) loop
-
-- Deferred constant signature
if Nkind (Decl) = N_Object_Declaration
Defining_Identifier (Decl));
end if;
+ end Inspect_Deferred_Constant_Completion;
+
+ procedure Inspect_Deferred_Constant_Completion (Decls : List_Id) is
+ Decl : Node_Id;
+
+ begin
+ Decl := First (Decls);
+ while Present (Decl) loop
+ Inspect_Deferred_Constant_Completion (Decl);
Next (Decl);
end loop;
end Inspect_Deferred_Constant_Completion;
-- prefix is an access type, rewrite the access type node N (which is the
-- prefix, e.g. of an indexed component) as an explicit dereference.
+ procedure Inspect_Deferred_Constant_Completion (Decl : Node_Id);
+ -- If Decl is a constant object declaration without a default value, check
+ -- whether it has been completed by a full constant declaration or an
+ -- Import pragma. Emit an error message if that is not the case.
+
procedure Inspect_Deferred_Constant_Completion (Decls : List_Id);
-- Examine all deferred constants in the declaration list Decls and check
-- whether they have been completed by a full constant declaration or an