diff mbox

[Ada] Add anonymous subtypes to ALFA

Message ID 20110804080328.GA6726@adacore.com
State New
Headers show

Commit Message

Arnaud Charlet Aug. 4, 2011, 8:03 a.m. UTC
Mark anonymous subtypes of enumeration and integer kind as being in ALFA,
following the same rules as for source subtypes.

Tested on x86_64-pc-linux-gnu, committed on trunk

2011-08-04  Yannick Moy  <moy@adacore.com>

	* sem_ch3.adb (Constrain_Enumeration, Constrain_Integer): remove
	constraint that subtype must come from source code to be in ALFA, so
	that anonymous subtypes can be in ALFA too.
diff mbox

Patch

Index: sem_ch3.adb
===================================================================
--- sem_ch3.adb	(revision 177324)
+++ sem_ch3.adb	(working copy)
@@ -11592,9 +11592,7 @@ 
       --  entity of its subtype mark is in ALFA. This is reversed later if the
       --  range of the subtype is not static.
 
-      if Nkind (Original_Node (Parent (Def_Id))) = N_Subtype_Declaration
-        and then Is_In_ALFA (T)
-      then
+      if Is_In_ALFA (T) then
          Set_Is_In_ALFA (Def_Id);
       end if;
 
@@ -11824,9 +11822,7 @@ 
       --  entity of its subtype mark is in ALFA. This is reversed later if the
       --  range of the subtype is not static.
 
-      if Nkind (Original_Node (Parent (Def_Id))) = N_Subtype_Declaration
-        and then Is_In_ALFA (T)
-      then
+      if Is_In_ALFA (T) then
          Set_Is_In_ALFA (Def_Id);
       end if;