diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2014-08-04 12:03:31 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2014-08-04 12:03:31 +0200 |
commit | 6d0b56ad0cbcc35f2e7b9cd24529a45ed1bbb865 (patch) | |
tree | 8573ab03acf640bc3322d78ca3cb883e6c81a7b9 /gcc/ada/checks.adb | |
parent | ff7a5bcbdf9f3d0c219550cd0aa0ef248f7504eb (diff) | |
download | gcc-6d0b56ad0cbcc35f2e7b9cd24529a45ed1bbb865.zip gcc-6d0b56ad0cbcc35f2e7b9cd24529a45ed1bbb865.tar.gz gcc-6d0b56ad0cbcc35f2e7b9cd24529a45ed1bbb865.tar.bz2 |
[multiple changes]
2014-08-04 Hristian Kirtchev <kirtchev@adacore.com>
* exp_ch3.adb (Build_CPP_Init_Procedure): Remove
Flag_Decl. Do not analyze the declaration of the flag as it is
not part of the tree yet, instead add it to the freeze actions
of the C++ type.
2014-08-04 Robert Dewar <dewar@adacore.com>
* checks.adb (Apply_Scalar_Range_Check): Make sure we handle
case of OUT and IN OUT parameter correctly (where Source_Typ is
set), we were missing one case where a check must be applied.
2014-08-04 Hristian Kirtchev <kirtchev@adacore.com>
* sem_ch8.adb (Build_Class_Wide_Wrapper): Update the comment on
the generated code. Instead of hiding the renaming and using the
wrapper as the proper association, have the subprogram renaming
alias the wrapper.
(Build_Spec): The entity of the wrapper is
now derived from the entity of the related primitive.
2014-08-04 Emmanuel Briot <briot@adacore.com>
* s-regpat.adb: s-regpat.adb (Parse): fix incorrect link when
using non-capturing groups.
2014-08-04 Ed Schonberg <schonberg@adacore.com>
* inline.adb (Build_Body_To_Inline): Remove Unmodified and
related pragmas before copying the original body, to prevent
spurious errors when the pragmas apply to formals that will not
appear in the inlined body.
From-SVN: r213554
Diffstat (limited to 'gcc/ada/checks.adb')
-rw-r--r-- | gcc/ada/checks.adb | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb index 8072629..05f4b7e 100644 --- a/gcc/ada/checks.adb +++ b/gcc/ada/checks.adb @@ -2971,11 +2971,18 @@ package body Checks is and then Is_Discrete_Type (S_Typ) = Is_Discrete_Type (Target_Typ) and then (In_Subrange_Of (S_Typ, Target_Typ, Fixed_Int) + + -- Also check if the expression itself is in the range of the + -- target type if it is a known at compile time value. We skip + -- this test if S_Typ is set since for OUT and IN OUT parameters + -- the Expr itself is not relevant to the checking. + or else - Is_In_Range (Expr, Target_Typ, - Assume_Valid => True, - Fixed_Int => Fixed_Int, - Int_Real => Int_Real)) + (No (Source_Typ) + and then Is_In_Range (Expr, Target_Typ, + Assume_Valid => True, + Fixed_Int => Fixed_Int, + Int_Real => Int_Real))) then return; |