aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch6.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2010-10-04 15:16:56 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2010-10-04 15:16:56 +0200
commit1366997bf20c36a7d0701a4f4e09b7d8b523e828 (patch)
treeb0a80bb7396b365be2b51d7d1140612193541c09 /gcc/ada/sem_ch6.adb
parentd4d24ba4503483a5315b57859c147f9a4e18c5aa (diff)
downloadgcc-1366997bf20c36a7d0701a4f4e09b7d8b523e828.zip
gcc-1366997bf20c36a7d0701a4f4e09b7d8b523e828.tar.gz
gcc-1366997bf20c36a7d0701a4f4e09b7d8b523e828.tar.bz2
[multiple changes]
2010-10-04 Vincent Celier <celier@adacore.com> * sinput-l.adb (Load_File): Do not fail when switch -gnateG is specified and the processed file cannot be written. Just issue a warning and continue. 2010-10-04 Thomas Quinot <quinot@adacore.com> * sem_res.adb: Minor reformatting. 2010-10-04 Ed Schonberg <schonberg@adacore.com> * sem_ch8.adb (Analyze_Subprogram_Renaming): If the renamed operation is an overridden inherited operation, the desired operation is the overriding one, which is the alias of the visible one. 2010-10-04 Ed Schonberg <schonberg@adacore.com> * sem_ch6.adb (Find_Corresponding_Spec): Check that the wrapper body is present before deleting from the tree, when an inherited function with a controlling result that returns a null extension is overridden by a later declaration or body. 2010-10-04 Gary Dismukes <dismukes@adacore.com> * checks.adb: Update comment. From-SVN: r164933
Diffstat (limited to 'gcc/ada/sem_ch6.adb')
-rw-r--r--gcc/ada/sem_ch6.adb19
1 files changed, 12 insertions, 7 deletions
diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb
index a379e3ae..80b3eb1 100644
--- a/gcc/ada/sem_ch6.adb
+++ b/gcc/ada/sem_ch6.adb
@@ -5910,8 +5910,8 @@ package body Sem_Ch6 is
-- that was created for an operation inherited by a null
-- extension, it may be overridden by a body without a previous
-- spec (one more reason why these should be shunned). In that
- -- case remove the generated body, because the current one is
- -- the explicit overriding.
+ -- case remove the generated body if present, because the
+ -- current one is the explicit overriding.
elsif Ekind (E) = E_Function
and then Ada_Version >= Ada_05
@@ -5922,15 +5922,20 @@ package body Sem_Ch6 is
then
Set_Has_Completion (E, False);
- if Expander_Active then
+ if Expander_Active
+ and then Nkind (Parent (E)) = N_Function_Specification
+ then
Remove
(Unit_Declaration_Node
- (Corresponding_Body (Unit_Declaration_Node (E))));
+ (Corresponding_Body (Unit_Declaration_Node (E))));
+
return E;
- -- If expansion is disabled, the wrapper function has not
- -- been generated, and this is the standard case of a late
- -- body overriding an inherited operation.
+ -- If expansion is disabled, or if the wrapper function has
+ -- not been generated yet, this a late body overriding an
+ -- inherited operation, or it is an overriding by some other
+ -- declaration before the controlling result is frozen. In
+ -- either case this is a declaration of a new entity.
else
return Empty;