aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_elim.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2011-08-02 12:06:14 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2011-08-02 12:06:14 +0200
commit8b3c64300b604fa06ca1e09b243bcfe424d883c0 (patch)
tree32596f0b0a7fd593fddbf191b5cca6d3fdbd88f6 /gcc/ada/sem_elim.adb
parentcae81f177de95c5de06a61f769f3008925ebcb35 (diff)
downloadgcc-8b3c64300b604fa06ca1e09b243bcfe424d883c0.zip
gcc-8b3c64300b604fa06ca1e09b243bcfe424d883c0.tar.gz
gcc-8b3c64300b604fa06ca1e09b243bcfe424d883c0.tar.bz2
[multiple changes]
2011-08-02 Thomas Quinot <quinot@adacore.com> * scos.ads: Update comments. 2011-08-02 Ed Schonberg <schonberg@adacore.com> * sem_ch3.adb (Build_Derived_Type): Inherit the convention from the base type, because the parent may be a subtype of a private type whose convention is established in a private part. 2011-08-02 Hristian Kirtchev <kirtchev@adacore.com> * exp_ch6.adb (Expand_N_Extended_Return_Statement): Wrap the return statement in a block when the expansion of the return expression has created a finalization chain. * freeze.adb (Freeze_Expression): Alphabetize all choices associated with the parent node. Add N_Extended_Return_Statement to handle the case where a transient object declaration appears in the Return_Object_Declarations list of an extended return statement. 2011-08-02 Matthew Gingell <gingell@adacore.com> * adaint.c (__gnat_is_symbolic_link_attr): Supress warning on possibly unused parameter 'name'. 2011-08-02 Ed Schonberg <schonberg@adacore.com> * sem_elim.adb (Set_Eliminated): If the overridden operation is an inherited operation, check whether its alias, which is the source operastion that it renames, has been marked eliminated. From-SVN: r177121
Diffstat (limited to 'gcc/ada/sem_elim.adb')
-rw-r--r--gcc/ada/sem_elim.adb19
1 files changed, 16 insertions, 3 deletions
diff --git a/gcc/ada/sem_elim.adb b/gcc/ada/sem_elim.adb
index 9f6374e..dedc52d 100644
--- a/gcc/ada/sem_elim.adb
+++ b/gcc/ada/sem_elim.adb
@@ -261,14 +261,27 @@ package body Sem_Elim is
--------------------
procedure Set_Eliminated is
+ Overridden : Entity_Id;
+
begin
if Is_Dispatching_Operation (E) then
-- If an overriding dispatching primitive is eliminated then
- -- its parent must have been eliminated.
+ -- its parent must have been eliminated. If the parent is an
+ -- inherited operation, check the operation that it renames,
+ -- because flag Eliminated is only set on source operations.
+
+ Overridden := Overridden_Operation (E);
+
+ if Present (Overridden)
+ and then not Comes_From_Source (Overridden)
+ and then Present (Alias (Overridden))
+ then
+ Overridden := Alias (Overridden);
+ end if;
- if Present (Overridden_Operation (E))
- and then not Is_Eliminated (Overridden_Operation (E))
+ if Present (Overridden)
+ and then not Is_Eliminated (Overridden)
then
Error_Msg_Name_1 := Chars (E);
Error_Msg_N ("cannot eliminate subprogram %", E);