+2001-12-04 Ed Schonberg <schonber@gnat.com>
+
+ * sem_ch3.adb (Find_Type_Of_Subtype_Indic): If subtype indication
+ is malformed, use instance of Any_Id to allow analysis to proceed.
+
+ * par-ch12.adb (P_Formal_Type_Declaration): Propagate Error if
+ type definition is illegal.
+ (P_Formal_Derived_Type_Definition): Better recovery when TAGGED is
+ misplaced.
+
2001-12-04 Ed Schonberg <schonber@gnat.com>
* sem_warn.adb (Output_Unreferenced_Messages): Extend previous fix to
-- --
-- B o d y --
-- --
--- $Revision: 1.46 $
+-- $Revision$
-- --
-- Copyright (C) 1992-2001 Free Software Foundation, Inc. --
-- --
function P_Formal_Type_Declaration return Node_Id is
Decl_Node : Node_Id;
+ Def_Node : Node_Id;
begin
Decl_Node := New_Node (N_Formal_Type_Declaration, Token_Ptr);
T_Is;
- Set_Formal_Type_Definition (Decl_Node, P_Formal_Type_Definition);
- TF_Semicolon;
+ Def_Node := P_Formal_Type_Definition;
+
+ if Def_Node /= Error then
+ Set_Formal_Type_Definition (Decl_Node, Def_Node);
+ TF_Semicolon;
+ else
+ Decl_Node := Error;
+ end if;
+
return Decl_Node;
end P_Formal_Type_Declaration;
Scan; -- past WITH
Set_Private_Present (Def_Node, True);
T_Private;
+
+ elsif Token = Tok_Tagged then
+ Scan;
+
+ if Token = Tok_Private then
+ Error_Msg_SC ("TAGGED should be WITH");
+ Set_Private_Present (Def_Node, True);
+ T_Private;
+ else
+ Ignore (Tok_Tagged);
+ end if;
end if;
return Def_Node;
-- --
-- B o d y --
-- --
--- $Revision: 1.2 $
+-- $Revision$
-- --
-- Copyright (C) 1992-2001, Free Software Foundation, Inc. --
-- --
-- Otherwise we have a subtype mark without a constraint
+ elsif Error_Posted (S) then
+ Rewrite (S, New_Occurrence_Of (Any_Id, Sloc (S)));
+ return Any_Type;
+
else
Find_Type (S);
Typ := Entity (S);