diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2015-11-12 12:42:00 +0100 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2015-11-12 12:42:00 +0100 |
commit | 7408c4a5e0d6723e11b043d9705b4e5b6b3b8a66 (patch) | |
tree | c6cadeec21c954d297eef79d14bd9968b167a763 /gcc/ada | |
parent | e3f94155df2c4223b92f63837d0d887502fa7e6e (diff) | |
download | gcc-7408c4a5e0d6723e11b043d9705b4e5b6b3b8a66.zip gcc-7408c4a5e0d6723e11b043d9705b4e5b6b3b8a66.tar.gz gcc-7408c4a5e0d6723e11b043d9705b4e5b6b3b8a66.tar.bz2 |
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
Diffstat (limited to 'gcc/ada')
-rw-r--r-- | gcc/ada/ChangeLog | 18 | ||||
-rw-r--r-- | gcc/ada/sem_ch4.adb | 11 |
2 files changed, 29 insertions, 0 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 13c2be1..cd0764a 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,21 @@ +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: diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb index 55a41f1..bf134ba 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; |