[Ada] Subprogram_Variant in ignored ghost code

gcc/ada/

	* exp_ch6.adb (Expand_Call_Helper): Do not call
	Check_Subprogram_Variant if the subprogram is an ignored ghost
	entity. Otherwise the compiler crashes (in debug builds) or
	gives strange error messages (in production builds).
This commit is contained in:
Bob Duff 2021-08-17 11:02:51 -04:00 committed by Pierre-Marie de Rodat
parent 29ada0e5a2
commit ea0b5b656a

View file

@ -4392,6 +4392,7 @@ package body Exp_Ch6 is
-- the current subprogram is called.
if Is_Subprogram (Subp)
and then not Is_Ignored_Ghost_Entity (Subp)
and then Same_Or_Aliased_Subprograms (Subp, Current_Scope)
then
Check_Subprogram_Variant;