-- For an access_to_protected_subprogram parameter it is the declaration
-- of the corresponding formal parameter.
---
--- Itypes have no explicit declaration, and therefore are not attached to
--- the tree: their Parent field is always empty. The Associated_Node_For_
--- Itype is the only way to determine the construct that leads to the
--- creation of a given itype entity.
+
+-- Itypes need not have an explicit declaration, in which case they are
+-- not attached to the tree through the Parent field, which is empty. In
+-- other cases, they have one and are attached to the tree through the
+-- Parent field as usual. Associated_Node_For_Itype should be used to
+-- determine the construct that leads to the creation of a given itype
+-- entity.
-- Associated_Storage_Pool [root type only]
-- Defined in simple and general access type entities. References the
-- False means disabled checks are silent; True means we print a message
-- (but still don't raise VAST_Failure).
- type Check_Enum is (Check_Other, Check_Itype_Parents, Check_Error_Nodes);
+ type Check_Enum is (Check_Other, Check_Error_Nodes);
Enabled_Checks : constant array (Check_Enum) of Boolean :=
--- (Check_Other => True, others => False);
- (others => True);
--- (Check_Itype_Parents => False, -- this one fails in bootstrap!
--- others => True);
+ (Check_Other => True,
+-- others => False);
+ others => True);
-- Passing checks are Check_Other, which should always be enabled.
-- Currently-failing checks are different enumerals in Check_Enum,
-- which can be disabled individually until we fix the bugs, or enabled
if Nkind (N) = N_Compilation_Unit then
Assert (No (Parent (N)));
-- The root of each unit should not have a parent
+
elsif N in N_Entity_Id and then Is_Itype (N) then
- Assert (No (Parent (N)), Check_Itype_Parents);
- -- Itypes should not have a parent
+ null; -- An Itype might or might not have a parent
+
else
if Nkind (N) = N_Error then
Assert (False, Check_Error_Nodes);