-- Local variables
P : constant Node_Id := Parent (S);
+ Mark : Node_Id;
Def_Id : Entity_Id;
Error_Node : Node_Id;
Full_View_Id : Entity_Id;
-- Start of processing for Process_Subtype
begin
- -- Case of no constraints present
+ if Nkind (S) = N_Subtype_Indication then
+ Mark := Subtype_Mark (S);
+ else
+ Mark := S;
+ end if;
- if Nkind (S) /= N_Subtype_Indication then
- Find_Type (S);
+ Find_Type (Mark);
- -- No way to proceed if the subtype indication is malformed. This
- -- will happen for example when the subtype indication in an object
- -- declaration is missing altogether and the expression is analyzed
- -- as if it were that indication.
+ -- No way to proceed if the subtype indication is malformed. This will
+ -- happen for example when the subtype indication in an object
+ -- declaration is missing altogether and the expression is analyzed as
+ -- if it were that indication.
- if not Is_Entity_Name (S) then
- return Any_Type;
- end if;
+ if not Is_Entity_Name (Mark) then
+ return Any_Type;
+ end if;
+
+ Check_Incomplete (Mark);
- Check_Incomplete (S);
+ -- Case of no constraints present
+ if Nkind (S) /= N_Subtype_Indication then
if Excludes_Null then
-- Create an Itype that is a duplicate of Entity (S) but with the
-- null-exclusion attribute.
-- node (this node is created only if constraints are present).
else
- Find_Type (Subtype_Mark (S));
-
- Check_Incomplete (Subtype_Mark (S));
-
- Subtype_Mark_Id := Entity (Subtype_Mark (S));
+ Subtype_Mark_Id := Entity (Mark);
-- Explicit subtype declaration case