Skip to content
Snippets Groups Projects
Commit 480819c9 authored by Steve Baird's avatar Steve Baird Committed by Marc Poulhiès
Browse files

ada: Etype missing for raise expression

If the primitive equality operator of the component type of an array type is
abstract, then a call to that abstract function raises Program_Error (when
such a call is legal). The FE generates a raise expression to implement this.
That raise expression is an expression so it should have a valid Etype.

gcc/ada/

	* exp_ch4.adb (Build_Eq_Call): In the abstract callee case, copy
	the Etype of the callee onto the Make_Raise_Program_Error result.
parent 85f2ffd8
No related branches found
No related tags found
No related merge requests found
......@@ -443,8 +443,11 @@ package body Exp_Ch4 is
begin
if Present (Eq) then
if Is_Abstract_Subprogram (Eq) then
return Make_Raise_Program_Error (Loc,
Reason => PE_Explicit_Raise);
return Result : constant Node_Id :=
Make_Raise_Program_Error (Loc, Reason => PE_Explicit_Raise)
do
Set_Etype (Result, Etype (Eq));
end return;
 
else
return
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment