+2018-07-31 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch4.adb (Traverse_Homonyms): Consider generic actuals that
+ may rename a matching class-wide operation only if the renaming
+ declaration for that actual is in an enclosing scope (i.e.
+ within the corrresponding instance).
+
2018-07-31 Hristian Kirtchev <kirtchev@adacore.com>
* checks.adb, contracts.adb, exp_aggr.adb, exp_ch5.adb,
-- to same. If in an instance, the operation can be considered
-- even if hidden (it may be hidden because the instantiation
-- is expanded after the containing package has been analyzed).
+ -- If the subprogram is a generic actual in an enclosing instance,
+ -- it appears as a renaming that is a candidate interpretation as
+ -- well.
Hom := Current_Entity (Subprog);
while Present (Hom) loop
if Ekind_In (Hom, E_Procedure, E_Function)
and then Present (Renamed_Entity (Hom))
and then Is_Generic_Actual_Subprogram (Hom)
+ and then In_Open_Scopes (Scope (Hom))
then
Candidate := Renamed_Entity (Hom);
else