From 3cb9a885dfef841f13f4b96fb5b1fae318f4a8bb Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Thu, 20 Nov 2014 11:01:05 +0100 Subject: [PATCH] [multiple changes] 2014-11-20 Robert Dewar * exp_ch7.adb, sem_ch5.adb, sem_ch7.adb, sem_util.adb, sem_ch6.adb: Minor reformatting. 2014-11-20 Javier Miranda * exp_ch4.adb (Expand_N_Type_Conversion): Add missing implicit conversion to force the displacement of the pointer to the object to reference the secondary dispatch table. From-SVN: r217829 --- gcc/ada/ChangeLog | 11 +++++++++++ gcc/ada/exp_ch4.adb | 4 +++- gcc/ada/exp_ch7.adb | 5 +++-- gcc/ada/sem_ch5.adb | 6 +++--- gcc/ada/sem_ch6.adb | 3 ++- gcc/ada/sem_ch7.adb | 3 ++- gcc/ada/sem_util.adb | 1 - gcc/ada/sem_util.ads | 4 ++-- 8 files changed, 26 insertions(+), 11 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index a5daae16c69..1dee651f977 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,14 @@ +2014-11-20 Robert Dewar + + * exp_ch7.adb, sem_ch5.adb, sem_ch7.adb, sem_util.adb, + sem_ch6.adb: Minor reformatting. + +2014-11-20 Javier Miranda + + * exp_ch4.adb (Expand_N_Type_Conversion): Add missing implicit + conversion to force the displacement of the pointer to the object + to reference the secondary dispatch table. + 2014-11-11 Simon Wright PR ada/42978 diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb index 1ed8f3bf146..ca58e47be6e 100644 --- a/gcc/ada/exp_ch4.adb +++ b/gcc/ada/exp_ch4.adb @@ -10622,7 +10622,9 @@ package body Exp_Ch4 is -- Ada 2005 (AI-251): Handle interface type conversion - if Is_Interface (Actual_Op_Typ) then + if Is_Interface (Actual_Op_Typ) + or else Is_Interface (Actual_Targ_Typ) + then Expand_Interface_Conversion (N); goto Done; end if; diff --git a/gcc/ada/exp_ch7.adb b/gcc/ada/exp_ch7.adb index 4b2a4120949..de60b4abed2 100644 --- a/gcc/ada/exp_ch7.adb +++ b/gcc/ada/exp_ch7.adb @@ -4778,8 +4778,9 @@ package body Exp_Ch7 is -- Generate: -- [Deep_]Finalize (Obj_Ref); - -- Set type of dereference, so that proper conversion are - -- generated when operation is inherited. + + -- Set type of dereference, so that proper conversion are + -- generated when operation is inherited. Obj_Ref := New_Occurrence_Of (Obj_Id, Loc); diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb index 2a809be40f4..1666917affb 100644 --- a/gcc/ada/sem_ch5.adb +++ b/gcc/ada/sem_ch5.adb @@ -2012,8 +2012,8 @@ package body Sem_Ch5 is else Set_Etype (Def_Id, Entity (Element)); - -- If subtype indication was given, verify that it - -- covers the element type of the container. + -- If subtype indication was given, verify that it covers + -- the element type of the container. if Present (Subt) and then not Covers (Bas, Etype (Def_Id)) @@ -2064,7 +2064,7 @@ package body Sem_Ch5 is ("\to iterate directly over the elements of a container, " & "write `of &`", Name (N), Original_Node (Name (N))); - -- No point in continuing analysis of iterator spec. + -- No point in continuing analysis of iterator spec return; end if; diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb index 97866c0b67e..11db3e4a690 100644 --- a/gcc/ada/sem_ch6.adb +++ b/gcc/ada/sem_ch6.adb @@ -4684,7 +4684,8 @@ package body Sem_Ch6 is -- If both are functions/operators, check return types conform if Old_Type /= Standard_Void_Type - and then New_Type /= Standard_Void_Type + and then + New_Type /= Standard_Void_Type then -- If we are checking interface conformance we omit controlling -- arguments and result, because we are only checking the conformance diff --git a/gcc/ada/sem_ch7.adb b/gcc/ada/sem_ch7.adb index ebc17a24f09..1acef30dee0 100644 --- a/gcc/ada/sem_ch7.adb +++ b/gcc/ada/sem_ch7.adb @@ -2444,7 +2444,8 @@ package body Sem_Ch7 is function Requires_Completion_In_Body (Id : Entity_Id; - Pack_Id : Entity_Id) return Boolean is + Pack_Id : Entity_Id) return Boolean + is begin -- Always ignore child units. Child units get added to the entity list -- of a parent unit, but are not original entities of the parent, and diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index b3982af884e..5a9117c8734 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -2759,7 +2759,6 @@ package body Sem_Util is and then Present (Generalized_Indexing (N)) then Nam := Generalized_Indexing (N); - else Nam := N; end if; diff --git a/gcc/ada/sem_util.ads b/gcc/ada/sem_util.ads index ff9c1697f94..7d9b2673f3d 100644 --- a/gcc/ada/sem_util.ads +++ b/gcc/ada/sem_util.ads @@ -939,8 +939,8 @@ package Sem_Util is -- as an access type internally, this function tests only for access types -- known to the programmer. See also Has_Tagged_Component. - function Has_Defaulted_Discriminants (Typ : Entity_Id) return Boolean; - -- Simple predicate to test for defaulted discriminants + function Has_Defaulted_Discriminants (Typ : Entity_Id) return Boolean; + -- Simple predicate to test for defaulted discriminants type Alignment_Result is (Known_Compatible, Unknown, Known_Incompatible); -- Result of Has_Compatible_Alignment test, description found below. Note -- 2.30.2