summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2010-10-04 13:16:56 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2010-10-04 13:16:56 +0000
commitf6742bc085755096f16bd4f80d89b53e5508d0be (patch)
treeb0a80bb7396b365be2b51d7d1140612193541c09
parentf83b64ca5fdab1eb0ddbd4266d7105b81b5294ec (diff)
downloadgcc-f6742bc085755096f16bd4f80d89b53e5508d0be.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@164933 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ada/ChangeLog27
-rw-r--r--gcc/ada/checks.adb9
-rw-r--r--gcc/ada/sem_ch6.adb19
-rw-r--r--gcc/ada/sem_ch8.adb15
-rw-r--r--gcc/ada/sem_res.adb36
-rw-r--r--gcc/ada/sinput-l.adb3
6 files changed, 72 insertions, 37 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index abc84298ca9..8596df4fb29 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,30 @@
+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.
+
2010-09-30 Joseph Myers <joseph@codesourcery.com>
* gcc-interface/misc.c (optimize, optimize_size): Undefine as macros
diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb
index 7448168566c..b67e8d6d66c 100644
--- a/gcc/ada/checks.adb
+++ b/gcc/ada/checks.adb
@@ -819,15 +819,6 @@ package body Checks is
-- node is retained, in order to avoid the warning for
-- redundant conversions in Resolve_Type_Conversion.
- -- The above comment is uncomfortable. This seems like
- -- an awkward covert channel, since there isno general
- -- requirement in sinfo.ads or einfo.ads that requires
- -- this rewrite. Instead, the issue seems to be that in
- -- the old code, some node was incorrectly marked as
- -- coming from source when it should not have been and/or
- -- the warning code did not properly test the appropriate
- -- Comes_From_Soure flag. ???
-
Rewrite (N, Relocate_Node (N));
Set_Etype (N, Target_Type);
diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb
index a379e3ae984..80b3eb19776 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;
diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb
index b61eeabc3d6..75e98ba188a 100644
--- a/gcc/ada/sem_ch8.adb
+++ b/gcc/ada/sem_ch8.adb
@@ -2100,6 +2100,21 @@ package body Sem_Ch8 is
if No (Old_S) then
Old_S := Find_Renamed_Entity (N, Name (N), New_S, Is_Actual);
+ -- The visible operation may be an inherited abstract operation that
+ -- was overridden in the private part, in which case a call will
+ -- dispatch to the overriding operation. Use the overriding one in
+ -- the renaming declaration, to prevent spurious errors below.
+
+ if Is_Overloadable (Old_S)
+ and then Is_Abstract_Subprogram (Old_S)
+ and then No (DTC_Entity (Old_S))
+ and then Present (Alias (Old_S))
+ and then not Is_Abstract_Subprogram (Alias (Old_S))
+ and then Is_Overriding_Operation (Alias (Old_S))
+ then
+ Old_S := Alias (Old_S);
+ end if;
+
-- When the renamed subprogram is overloaded and used as an actual
-- of a generic, its entity is set to the first available homonym.
-- We must first disambiguate the name, then set the proper entity.
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
index 7cca8abe463..fa0b66be5b4 100644
--- a/gcc/ada/sem_res.adb
+++ b/gcc/ada/sem_res.adb
@@ -8847,9 +8847,8 @@ package body Sem_Res is
-- own expression is a possibly overloaded function call. The
-- qualified expression is needed to be disambiguate the call,
-- but it appears in a context in which a name is needed, forcing
- -- the use of a conversion.
- -- In Ada2012 a qualified expression is a name, and this idiom
- -- is not needed any longer.
+ -- the use of a conversion. In Ada 2012, a qualified expression is
+ -- a name, and this idiom is no longer needed.
elsif Nkind (Orig_N) = N_Qualified_Expression
and then Nkind (Expression (Orig_N)) = N_Function_Call
@@ -9255,9 +9254,9 @@ package body Sem_Res is
Rewrite (N, Op_Node);
- -- If the context type is private, add the appropriate conversions
- -- so that the operator is applied to the full view. This is done
- -- in the routines that resolve intrinsic operators,
+ -- If the context type is private, add the appropriate conversions so
+ -- that the operator is applied to the full view. This is done in the
+ -- routines that resolve intrinsic operators.
if Is_Intrinsic_Subprogram (Op)
and then Is_Private_Type (Typ)
@@ -9277,9 +9276,8 @@ package body Sem_Res is
elsif Ekind (Op) = E_Function and then Is_Intrinsic_Subprogram (Op) then
- -- Operator renames a user-defined operator of the same name. Use
- -- the original operator in the node, which is the one that Gigi
- -- knows about.
+ -- Operator renames a user-defined operator of the same name. Use the
+ -- original operator in the node, which is the one Gigi knows about.
Set_Entity (N, Op);
Set_Is_Overloaded (N, False);
@@ -9290,12 +9288,12 @@ package body Sem_Res is
-- Set_Slice_Subtype --
-----------------------
- -- Build an implicit subtype declaration to represent the type delivered
- -- by the slice. This is an abbreviated version of an array subtype. We
- -- define an index subtype for the slice, using either the subtype name
- -- or the discrete range of the slice. To be consistent with index usage
- -- elsewhere, we create a list header to hold the single index. This list
- -- is not otherwise attached to the syntax tree.
+ -- Build an implicit subtype declaration to represent the type delivered by
+ -- the slice. This is an abbreviated version of an array subtype. We define
+ -- an index subtype for the slice, using either the subtype name or the
+ -- discrete range of the slice. To be consistent with index usage elsewhere
+ -- we create a list header to hold the single index. This list is not
+ -- otherwise attached to the syntax tree.
procedure Set_Slice_Subtype (N : Node_Id) is
Loc : constant Source_Ptr := Sloc (N);
@@ -9401,10 +9399,10 @@ package body Sem_Res is
if Is_OK_Static_Expression (Low_Bound) then
- -- The low bound is set from the low bound of the corresponding
- -- index type. Note that we do not store the high bound in the
- -- string literal subtype, but it can be deduced if necessary
- -- from the length and the low bound.
+ -- The low bound is set from the low bound of the corresponding index
+ -- type. Note that we do not store the high bound in the string literal
+ -- subtype, but it can be deduced if necessary from the length and the
+ -- low bound.
Set_String_Literal_Low_Bound (Subtype_Id, Low_Bound);
diff --git a/gcc/ada/sinput-l.adb b/gcc/ada/sinput-l.adb
index d29659755ff..98ad104d020 100644
--- a/gcc/ada/sinput-l.adb
+++ b/gcc/ada/sinput-l.adb
@@ -591,10 +591,9 @@ package body Sinput.L is
if not Status then
Errout.Error_Msg
- ("could not write processed file """ &
+ ("?could not write processed file """ &
Name_Buffer (1 .. Name_Len) & '"',
Lo);
- return No_Source_File;
end if;
end;
end if;