* par-endh.adb (Output_End_Expected): We should also not test
Error_Posted on the Error node, since now it is always set.
* cstand.adb (Create_Standard): Set Etype of Error to Any_Type
to help error recovery. Part of general work on 9407-004.
* par.adb: Add ??? for misuse of error
* sem_res.adb:
(Resolve): Defend against Error, fixes 9407-003.
(Resolve_Discrete_Subtype_Indication): Defend against Error.
* sinfo.ads (N_Error): Now has Etype field (which will be set
to Any_Type to help error recovery).
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@46077
138bc75d-0d04-0410-961f-
82ee72b054a4
+2001-10-08 Robert Dewar <dewar@gnat.com>
+
+ * atree.adb: Set Error_Posted in Error node, helps error recovery.
+
+ * par-endh.adb (Output_End_Expected): We should also not test
+ Error_Posted on the Error node, since now it is always set.
+
+ * cstand.adb (Create_Standard): Set Etype of Error to Any_Type
+ to help error recovery. Part of general work on 9407-004.
+
+ * par.adb: Add ??? for misuse of error
+
+ * sem_res.adb:
+ (Resolve): Defend against Error, fixes 9407-003.
+ (Resolve_Discrete_Subtype_Indication): Defend against Error.
+
+ * sinfo.ads (N_Error): Now has Etype field (which will be set
+ to Any_Type to help error recovery).
+
2001-10-08 Richard Kenner (kenner@gnat.com)
* misc.c (gnat_expand_expr, case UNCHECKED_CONVERT_EXPR):
-- --
-- B o d y --
-- --
--- $Revision: 1.205 $
+-- $Revision$
-- --
-- Copyright (C) 1992-2001, Free Software Foundation, Inc. --
-- --
Dummy : Node_Id;
begin
- -- Allocate Empty and Error nodes
+ -- Allocate Empty node
Dummy := New_Node (N_Empty, No_Location);
Set_Name1 (Empty, No_Name);
+
+ -- Allocate Error node, and set Error_Posted, since we certainly
+ -- only generate an Error node if we do post some kind of error!
+
Dummy := New_Node (N_Error, No_Location);
Set_Name1 (Error, Error_Name);
-
+ Set_Error_Posted (Error, True);
end Initialize;
--------------------------
-- --
-- B o d y --
-- --
--- $Revision: 1.213 $
+-- $Revision$
-- --
-- Copyright (C) 1992-2001 Free Software Foundation, Inc. --
-- --
Last_Standard_Node_Id := Last_Node_Id;
Last_Standard_List_Id := Last_List_Id;
+ -- The Error node has an Etype of Any_Type to help error recovery
+
+ Set_Etype (Error, Any_Type);
end Create_Standard;
------------------------------------
-- --
-- B o d y --
-- --
--- $Revision: 1.61 $
+-- $Revision$
-- --
-- Copyright (C) 1992-2001, Free Software Foundation, Inc. --
-- --
-- Suppress message if error was posted on opening label
- if Present (Error_Msg_Node_1)
+ if Error_Msg_Node_1 > Empty_Or_Error
and then Error_Posted (Error_Msg_Node_1)
then
return;
-- --
-- B o d y --
-- --
--- $Revision: 1.126 $
+-- $Revision$
-- --
-- Copyright (C) 1992-2001 Free Software Foundation, Inc. --
-- --
-- field references an N_Defining_Program_Unit_Name node for the name.
-- For cases other than LOOP or BEGIN, the Label field is set to Error,
-- indicating that it is an error to have a label on the end line.
+ -- (this is really a misuse of Error since there is no Error ???)
Decl : List_Id;
-- Points to the list of declarations (i.e. the declarative part)
-- --
-- B o d y --
-- --
--- $Revision: 1.717 $
+-- $Revision$
-- --
-- Copyright (C) 1992-2001, Free Software Foundation, Inc. --
-- --
-- Start of processing for Resolve
begin
+ if N = Error then
+ return;
+ end if;
+
-- Access attribute on remote subprogram cannot be used for
-- a non-remote access-to-subprogram type.
else
R := Range_Expression (Constraint (N));
+
+ if R = Error then
+ return;
+ end if;
+
Analyze (R);
if Base_Type (S) /= Base_Type (Typ) then
-- --
-- S p e c --
-- --
--- $Revision: 1.430 $
+-- $Revision: 1.1 $
-- --
-- Copyright (C) 1992-2001, Free Software Foundation, Inc. --
-- --
-- Empty --
-----------
- -- N_Empty
- -- Chars (Name1) is set to No_Name
-- Used as the contents of the Nkind field of the dummy Empty node
-- and in some other situations to indicate an uninitialized value.
+ -- N_Empty
+ -- Chars (Name1) is set to No_Name
+
-----------
-- Error --
-----------
+ -- Used as the contents of the Nkind field of the dummy Error node.
+ -- Has an Etype field, which gets set to Any_Type later on, to help
+ -- error recovery (Error_Posted is also set in the Error node).
+
-- N_Error
-- Chars (Name1) is set to Error_Name
- -- Used as the contents of the Nkind field of the dummy Error node
+ -- Etype (Node5-Sem)
--------------------------
-- Node Type Definition --
-- N_Has_Chars
N_Empty,
- N_Error,
N_Pragma,
N_Pragma_Argument_Association,
+ -- N_Has_Etype
+ N_Error,
+
-- N_Entity, N_Has_Etype, N_Has_Chars
N_Defining_Character_Literal,
N_Defining_Identifier,
-- Warning: DOES NOT INCLUDE N_Freeze_Entity!
subtype N_Has_Etype is Node_Kind range
- N_Defining_Character_Literal ..
+ N_Error ..
N_Subtype_Indication;
subtype N_Later_Decl_Item is Node_Kind range