aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEd Schonberg <schonber@gnat.com>2001-12-05 01:21:50 +0000
committerGeert Bosch <bosch@gcc.gnu.org>2001-12-05 02:21:50 +0100
commitdd5875a602fb7adef53362fab59cac17bf5ff77d (patch)
tree4de851084a11f871b428c1fb704ca47b0a489838 /gcc
parentc2a41e5742cf485f42a6aba845a0d71b72bc5d0a (diff)
downloadgcc-dd5875a602fb7adef53362fab59cac17bf5ff77d.zip
gcc-dd5875a602fb7adef53362fab59cac17bf5ff77d.tar.gz
gcc-dd5875a602fb7adef53362fab59cac17bf5ff77d.tar.bz2
sem_ch3.adb (Find_Type_Of_Subtype_Indic): If subtype indication is malformed...
* 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. From-SVN: r47642
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog10
-rw-r--r--gcc/ada/par-ch12.adb25
-rw-r--r--gcc/ada/sem_ch3.adb6
3 files changed, 37 insertions, 4 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 7d9a411..72e747d 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,5 +1,15 @@
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
constants.
diff --git a/gcc/ada/par-ch12.adb b/gcc/ada/par-ch12.adb
index 139243e..5d5dded 100644
--- a/gcc/ada/par-ch12.adb
+++ b/gcc/ada/par-ch12.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- $Revision: 1.46 $
+-- $Revision$
-- --
-- Copyright (C) 1992-2001 Free Software Foundation, Inc. --
-- --
@@ -431,6 +431,7 @@ package body Ch12 is
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);
@@ -446,8 +447,15 @@ package body Ch12 is
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;
@@ -621,6 +629,17 @@ package body Ch12 is
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;
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
index f3b0de0..2b481bd 100644
--- a/gcc/ada/sem_ch3.adb
+++ b/gcc/ada/sem_ch3.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- $Revision: 1.2 $
+-- $Revision$
-- --
-- Copyright (C) 1992-2001, Free Software Foundation, Inc. --
-- --
@@ -9300,6 +9300,10 @@ package body Sem_Ch3 is
-- 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);