From: charlet Date: Thu, 12 Nov 2015 11:42:00 +0000 (+0000) Subject: 2015-11-12 Thomas Quinot X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=595cbbcf5e5ae6e422d77e9ce5b0b30f2b42e195;p=thirdparty%2Fgcc.git 2015-11-12 Thomas Quinot * 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230241 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 13c2be14cb92..cd0764a4a86a 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,21 @@ +2015-11-12 Thomas Quinot + + * 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 + + * init.c: Do not try to mess with the MSR values in RTP mode: + not needed and forbidden. + +2015-11-12 Ed Schonberg + + * 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 * init.c: Do not try to mess with the MSR values in RTP mode: diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb index 55a41f1c156d..bf134ba8640f 100644 --- a/gcc/ada/sem_ch4.adb +++ b/gcc/ada/sem_ch4.adb @@ -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;