]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
sem_ch7.adb (New_Private_Type): Set Is_Tagged_Type flag before processing discriminan...
authorEd Schonberg <schonber@gnat.com>
Wed, 5 Dec 2001 01:43:31 +0000 (01:43 +0000)
committerGeert Bosch <bosch@gcc.gnu.org>
Wed, 5 Dec 2001 01:43:31 +0000 (02:43 +0100)
* sem_ch7.adb (New_Private_Type): Set Is_Tagged_Type flag before
processing discriminants to diagnose illegal default values.

From-SVN: r47645

gcc/ada/ChangeLog
gcc/ada/sem_ch7.adb

index ea362f117316abc7a80bc9d835fa972d67aa61eb..8aa8b16703546f191b70bc3495ac279c35004df2 100644 (file)
@@ -1,3 +1,8 @@
+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.
+
 2001-12-04  Ed Schonberg <schonber@gnat.com>
 
        * sem_attr.adb (Resolve_Attribute): Handle properly an non-classwide 
index c1b0521b38a8fa60b466e8c8b7914731866fe0ad..74d70d1fed867270a7ce8a1b80d5e967ebe2e6e6 100644 (file)
@@ -6,7 +6,7 @@
 --                                                                          --
 --                                 B o d y                                  --
 --                                                                          --
---                            $Revision: 1.335 $
+--                            $Revision$
 --                                                                          --
 --          Copyright (C) 1992-2001, Free Software Foundation, Inc.         --
 --                                                                          --
@@ -1308,6 +1308,11 @@ package body Sem_Ch7 is
         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,7 +1328,6 @@ package body Sem_Ch7 is
       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);