diff options
author | bosch <bosch@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-12-05 01:21:50 +0000 |
---|---|---|
committer | bosch <bosch@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-12-05 01:21:50 +0000 |
commit | 8803f1997eb896f82714caa5d29cacc6e0105011 (patch) | |
tree | 4de851084a11f871b428c1fb704ca47b0a489838 /gcc/ada/par-ch12.adb | |
parent | 6afd31fc8be8eaa84bb98e35f2bc57d82b34e1e0 (diff) | |
download | gcc-8803f1997eb896f82714caa5d29cacc6e0105011.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@47642 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/par-ch12.adb')
-rw-r--r-- | gcc/ada/par-ch12.adb | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/gcc/ada/par-ch12.adb b/gcc/ada/par-ch12.adb index 139243e67e2..5d5dded4d30 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; |