diff options
author | Ed Schonberg <schonberg@adacore.com> | 2017-01-06 11:03:36 +0000 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2017-01-06 12:03:36 +0100 |
commit | 6eca51ce090586d67fe01897c848bb224142549f (patch) | |
tree | b340effce88373fff5af0e2b3edde9115f90af08 /gcc/ada/sem_ch3.adb | |
parent | 6413509bd47c3d3c2c9160d5d13a5d4f40903456 (diff) | |
download | gcc-6eca51ce090586d67fe01897c848bb224142549f.zip gcc-6eca51ce090586d67fe01897c848bb224142549f.tar.gz gcc-6eca51ce090586d67fe01897c848bb224142549f.tar.bz2 |
exp_ch5.adb (Get_Default_Iterator): For a derived type...
2017-01-06 Ed Schonberg <schonberg@adacore.com>
* exp_ch5.adb (Get_Default_Iterator): For a derived type, the
alias of the inherited op is the parent iterator, no need to
examine dispatch table positions which might not be established
yet if type is not frozen.
* sem_disp.adb (Check_Controlling_Formals): The formal of a
predicate function may be a subtype of a tagged type.
* sem_ch3.adb (Complete_Private_Subtype): Adjust inheritance
of representation items for the completion of a type extension
where a predicate applies to the partial view.
* checks.ads, checks.adb (Apply_Predicate_Check): Add optional
parameter that designates function whose actual receives a
predicate check, to improve warning message when the check will
lead to infinite recursion.
* sem_res.adb (Resolve_Actuals): Pass additional parameter to
Apply_Predicate_Check.
From-SVN: r244132
Diffstat (limited to 'gcc/ada/sem_ch3.adb')
-rw-r--r-- | gcc/ada/sem_ch3.adb | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb index 5e659fd..d00a31c 100644 --- a/gcc/ada/sem_ch3.adb +++ b/gcc/ada/sem_ch3.adb @@ -11947,9 +11947,11 @@ package body Sem_Ch3 is Append : Boolean; Item : Node_Id; Next_Item : Node_Id; + Priv_Item : Node_Id; begin Item := First_Rep_Item (Full); + Priv_Item := First_Rep_Item (Priv); -- If no existing rep items on full type, we can just link directly -- to the list of items on the private type, if any exist.. Same if @@ -11960,14 +11962,24 @@ package body Sem_Ch3 is or else Entity (Item) = Full_Base) and then Present (First_Rep_Item (Priv)) then - Set_First_Rep_Item (Full, First_Rep_Item (Priv)); + Set_First_Rep_Item (Full, Priv_Item); -- Otherwise, search to the end of items currently linked to the full -- subtype and append the private items to the end. However, if Priv -- and Full already have the same list of rep items, then the append -- is not done, as that would create a circularity. + -- + -- The partial view may have a predicate and the rep item lists of + -- both views agree when inherited from the same ancestor. In that + -- case, simply propagate the list from one view to the other. + -- A more complex analysis needed here ??? + + elsif Present (Priv_Item) + and then Item = Next_Rep_Item (Priv_Item) + then + Set_First_Rep_Item (Full, Priv_Item); - elsif Item /= First_Rep_Item (Priv) then + elsif Item /= Priv_Item then Append := True; loop Next_Item := Next_Rep_Item (Item); |