Message ID | 20220705082954.GA3185056@adacore.com |
---|---|
State | New |
Headers | show |
Series | [Ada] Spurious error on qualified prefix in Pack.Func'Result | expand |
diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -5835,6 +5835,12 @@ package body Sem_Attr is elsif Present (Over_Id) and then Pref_Id = Over_Id then return True; + + -- When a qualified name is used for the prefix, homonyms may come + -- before the current function in the homonym chain. + + elsif Has_Homonym (Pref_Id) then + return Denote_Same_Function (Homonym (Pref_Id), Spec_Id); end if; -- Otherwise the prefix does not denote the related subprogram