Commit 7408c4a5 by Arnaud Charlet

sem_ch4.adb (analyze_If_Expression): Reject IF-expression where THEN-expression…

sem_ch4.adb (analyze_If_Expression): Reject IF-expression where THEN-expression is overloaded and none of its...

2015-11-12  Thomas Quinot  <quinot@adacore.com>

	* sem_ch4.adb (analyze_If_Expression): Reject IF-expression where
	THEN-expression is overloaded and none of its interpretation is
	compatible with the ELSE-expression.

From-SVN: r230241
parent e3f94155
2015-11-12 Thomas Quinot <quinot@adacore.com>
* sem_ch4.adb (analyze_If_Expression): Reject IF-expression where
THEN-expression is overloaded and none of its interpretation is
compatible with the ELSE-expression.
2015-11-12 Jerome Lambourg <lambourg@adacore.com>
* init.c: Do not try to mess with the MSR values in RTP mode:
not needed and forbidden.
2015-11-12 Ed Schonberg <schonberg@adacore.com>
* exp_attr.adb (Compile_Stream_Body_In_Scope): Do not install
full view of a type that has pragma Stream_Convert, because
this indicates special processing for the stream operations of
the type.
2015-11-12 Jerome Lambourg <lambourg@adacore.com>
* init.c: Do not try to mess with the MSR values in RTP mode:
......
......@@ -2191,6 +2191,17 @@ package body Sem_Ch4 is
Get_Next_Interp (I, It);
end loop;
-- If no valid interpretation has been found, then the type of
-- the ELSE expression does not match any interpretation of
-- the THEN expression.
if Etype (N) = Any_Type then
Error_Msg_N
("type incompatible with that of `THEN` expression",
Else_Expr);
return;
end if;
end;
end if;
end Analyze_If_Expression;
......
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