Commit c0def2ad by Ed Schonberg Committed by Geert Bosch

sem_ch7.adb (New_Private_Type): Set Is_Tagged_Type flag before processing…

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

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

From-SVN: r47645
parent 0626ef8a
2001-12-04 Ed Schonberg <schonber@gnat.com> 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 * sem_attr.adb (Resolve_Attribute): Handle properly an non-classwide
access discriminant within a type extension that constrains its access discriminant within a type extension that constrains its
parent discriminants. parent discriminants.
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- $Revision: 1.335 $ -- $Revision$
-- -- -- --
-- Copyright (C) 1992-2001, Free Software Foundation, Inc. -- -- Copyright (C) 1992-2001, Free Software Foundation, Inc. --
-- -- -- --
...@@ -1308,6 +1308,11 @@ package body Sem_Ch7 is ...@@ -1308,6 +1308,11 @@ package body Sem_Ch7 is
No (Discriminant_Specifications (N)) No (Discriminant_Specifications (N))
and then not Unknown_Discriminants_Present (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_Discriminant_Constraint (Id, No_Elist);
Set_Girder_Constraint (Id, No_Elist); Set_Girder_Constraint (Id, No_Elist);
...@@ -1323,7 +1328,6 @@ package body Sem_Ch7 is ...@@ -1323,7 +1328,6 @@ package body Sem_Ch7 is
Set_Private_Dependents (Id, New_Elmt_List); Set_Private_Dependents (Id, New_Elmt_List);
if Tagged_Present (Def) then if Tagged_Present (Def) then
Set_Is_Tagged_Type (Id, True);
Set_Ekind (Id, E_Record_Type_With_Private); Set_Ekind (Id, E_Record_Type_With_Private);
Make_Class_Wide_Type (Id); Make_Class_Wide_Type (Id);
Set_Primitive_Operations (Id, New_Elmt_List); Set_Primitive_Operations (Id, New_Elmt_List);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment