sem_ch6.adb (New_Overloaded_Entity, [...]): Do not set Overridden_Operation if subpro...
authorEd Schonberg <schonberg@adacore.com>
Tue, 2 Aug 2011 10:25:26 +0000 (10:25 +0000)
committerArnaud Charlet <charlet@gcc.gnu.org>
Tue, 2 Aug 2011 10:25:26 +0000 (12:25 +0200)
2011-08-02  Ed Schonberg  <schonberg@adacore.com>

* sem_ch6.adb (New_Overloaded_Entity, Check_Overriding_Indicator): Do
not set Overridden_Operation if subprogram is an initialization
procedure.

From-SVN: r177126

gcc/ada/ChangeLog
gcc/ada/sem_ch6.adb

index 6507dea5a22bbd767874165aed7f5be7cd30a3aa..f865c0b7e6074dcfd5fecb431cfea7afe093f7b6 100644 (file)
@@ -1,3 +1,9 @@
+2011-08-02  Ed Schonberg  <schonberg@adacore.com>
+
+       * sem_ch6.adb (New_Overloaded_Entity, Check_Overriding_Indicator): Do
+       not set Overridden_Operation if subprogram is an initialization
+       procedure.
+
 2011-08-02  Yannick Moy  <moy@adacore.com>
 
        * par-ch6.adb: Correct obsolete name in comments
index c0b17fe325f7115ea90070e2bd941ab99f7d43f3..a872e900f4612bba4148e9ca66d7aaefb060f9d9 100644 (file)
@@ -4804,7 +4804,10 @@ package body Sem_Ch6 is
             end if;
 
          elsif Is_Subprogram (Subp) then
-            if No (Overridden_Operation (Subp)) then
+            if Is_Init_Proc (Subp) then
+               null;
+
+            elsif No (Overridden_Operation (Subp)) then
 
                --  For entities generated by Derive_Subprograms the overridden
                --  operation is the inherited primitive (which is available
@@ -4819,6 +4822,7 @@ package body Sem_Ch6 is
                  and then Comes_From_Source (Alias (Overridden_Subp))
                then
                   Set_Overridden_Operation (Subp, Alias (Overridden_Subp));
+
                else
                   Set_Overridden_Operation (Subp, Overridden_Subp);
                end if;
@@ -8362,7 +8366,8 @@ package body Sem_Ch6 is
                        and then Comes_From_Source (Alias (E))
                      then
                         Set_Overridden_Operation (S, Alias (E));
-                     else
+
+                     elsif not Is_Init_Proc (S) then
                         Set_Overridden_Operation (S, E);
                      end if;