From 2fe829aee4382946ff335be64c2e2d4a1f79f484 Mon Sep 17 00:00:00 2001 From: Ed Schonberg Date: Tue, 2 Aug 2011 10:25:26 +0000 Subject: [PATCH] sem_ch6.adb (New_Overloaded_Entity, [...]): Do not set Overridden_Operation if subprogram is an initialization procedure. 2011-08-02 Ed Schonberg * 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 | 6 ++++++ gcc/ada/sem_ch6.adb | 9 +++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 6507dea5a22..f865c0b7e60 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,9 @@ +2011-08-02 Ed Schonberg + + * 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 * par-ch6.adb: Correct obsolete name in comments diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb index c0b17fe325f..a872e900f46 100644 --- a/gcc/ada/sem_ch6.adb +++ b/gcc/ada/sem_ch6.adb @@ -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; -- 2.30.2