[Ada] Return when not working for procedures

gcc/ada/

	* par-ch6.adb (Get_Return_Kind): Properly handle the case of a
	"return when" statement in the procedure case.
This commit is contained in:
Justin Squirek 2021-05-07 12:26:09 -04:00 committed by Pierre-Marie de Rodat
parent f037632e65
commit c7959e489d
1 changed files with 5 additions and 0 deletions

View File

@ -1903,6 +1903,11 @@ package body Ch6 is
end if;
Restore_Scan_State (Scan_State); -- to identifier
elsif Token = Tok_When then
Error_Msg_GNAT_Extension ("return when statement");
Result := Return_When;
end if;
return Result;