Commit 0d8b6803 by Javier Miranda Committed by Pierre-Marie de Rodat

[Ada] Avoid compiler crash for body in non Ada 2012 mode

2018-05-21  Javier Miranda  <miranda@adacore.com>

gcc/ada/

	* sem_ch4.adb (Analyze_Membership_Op): Avoid compiler crash when the
	spec of a unit has Ada 2012 membership tests with multiple choices and
	the unit body is not compiled under Ada 2012 mode.

From-SVN: r260464
parent 92689021
2018-04-04 Javier Miranda <miranda@adacore.com>
* sem_ch4.adb (Analyze_Membership_Op): Avoid compiler crash when the
spec of a unit has Ada 2012 membership tests with multiple choices and
the unit body is not compiled under Ada 2012 mode.
2018-04-04 Doug Rupp <rupp@adacore.com>
* sigtramp-vxworks-target.inc: Set cfa_reg properly from sigcontext
......
......@@ -3030,9 +3030,15 @@ package body Sem_Ch4 is
begin
Analyze_Expression (L);
if No (R) and then Ada_Version >= Ada_2012 then
Analyze_Set_Membership;
Check_Function_Writable_Actuals (N);
if No (R) then
if Ada_Version >= Ada_2012 then
Analyze_Set_Membership;
Check_Function_Writable_Actuals (N);
else
Error_Msg_N
("multiple choices in membership tests only allowed in Ada 2012",
N);
end if;
return;
end if;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment