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] Diagnose illegal default for private tagged record discriminant


2001-12-04  Ed Schonberg <schonber@gnat.com>

	* sem_ch7.adb (New_Private_Type): Set Is_Tagged_Type flag before 
	processing discriminants to diagnose illegal default values.

*** sem_ch7.adb	2001/06/19 18:42:22	1.335
--- sem_ch7.adb	2001/10/16 18:09:39	1.336
***************
*** 1308,1313 ****
--- 1308,1318 ----
          No (Discriminant_Specifications (N))
            and then not Unknown_Discriminants_Present (N));
  
+       --  Set tagged flag before processing discriminants, to catch
+       --  illegal usage.
+ 
+       Set_Is_Tagged_Type (Id, Tagged_Present (Def));
+ 
        Set_Discriminant_Constraint (Id, No_Elist);
        Set_Girder_Constraint (Id, No_Elist);
  
***************
*** 1323,1329 ****
        Set_Private_Dependents (Id, New_Elmt_List);
  
        if Tagged_Present (Def) then
-          Set_Is_Tagged_Type       (Id, True);
           Set_Ekind                (Id, E_Record_Type_With_Private);
           Make_Class_Wide_Type     (Id);
           Set_Primitive_Operations (Id, New_Elmt_List);
--- 1328,1333 ----


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