[Ada] Spurious error on qualified prefix in Pack.Func'Result

When using a qualified name such as Pack.Func as the prefix of a 'Result
attribute reference, the prefix is not fully resolved and may contain a
chain of homonyms. Look for the expected function in the homonym chain
instead of issuing an error if the first one is not the expected one.

gcc/ada/

	* sem_attr.adb (Analyze_Attribute): Take into account the
	possibility of homonyms.
1 file changed