This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Ada] Fix ACATS BC51018 - "compilation abandoned" with -gnatq


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.

*** sem_ch3.adb	2001/10/07 15:18:44	1.1357
--- sem_ch3.adb	2001/10/14 16:47:59	1.1358
***************
*** 9307,9312 ****
--- 9307,9316 ----
  
        --  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);

*** par-ch12.adb	2001/02/11 04:03:11	1.46
--- par-ch12.adb	2001/10/18 15:18:57	1.47
***************
*** 431,436 ****
--- 431,437 ----
  
     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,453 ****
  
        T_Is;
  
!       Set_Formal_Type_Definition (Decl_Node, P_Formal_Type_Definition);
!       TF_Semicolon;
        return Decl_Node;
     end P_Formal_Type_Declaration;
  
--- 447,461 ----
  
        T_Is;
  
!       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,626 ****
--- 629,645 ----
           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;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]