aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/checks.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2017-01-23 13:04:16 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2017-01-23 13:04:16 +0100
commita51368fad9985f84e3215cf9897f389698fbbba5 (patch)
treef3b135f9f55bd902b705221e118ad19c1baacb63 /gcc/ada/checks.adb
parentc7775327e8cf214872b3d179bfaa1b441759ab5a (diff)
downloadgcc-a51368fad9985f84e3215cf9897f389698fbbba5.zip
gcc-a51368fad9985f84e3215cf9897f389698fbbba5.tar.gz
gcc-a51368fad9985f84e3215cf9897f389698fbbba5.tar.bz2
[multiple changes]
2017-01-23 Pascal Obry <obry@adacore.com> * s-taprop-mingw.adb (Enter_Task): Initialize the Thread handle which is needed when a foreign thread call a Win32 API using a thread handle like GetThreadTimes() for example. 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com> * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Do not allow an 'Address clause to be specified on a prefix of a class-wide type. 2017-01-23 Hristian Kirtchev <kirtchev@adacore.com> * checks.adb (Insert_Valid_Check): Ensure that the prefix of attribute 'Valid is a renaming of the original expression when the expression denotes a name. For all other kinds of expression, use a constant to capture the value. * exp_util.adb (Is_Name_Reference): Moved to Sem_Util. * sem_util.ads, sem_util.adb (Is_Name_Reference): Moved from Exp_Util. 2017-01-23 Justin Squirek <squirek@adacore.com> * sem_eval.adb (Eval_Integer_Literal): Add special case to avoid optimizing out check if the literal appears in an if-expression. From-SVN: r244792
Diffstat (limited to 'gcc/ada/checks.adb')
-rw-r--r--gcc/ada/checks.adb8
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb
index 7f4a589..011878eb 100644
--- a/gcc/ada/checks.adb
+++ b/gcc/ada/checks.adb
@@ -7206,12 +7206,18 @@ package body Checks is
Force_Evaluation (Exp, Name_Req => False);
end if;
- -- Build the prefix for the 'Valid call
+ -- Build the prefix for the 'Valid call. If the expression denotes
+ -- a name, use a renaming to alias it, otherwise use a constant to
+ -- capture the value of the expression.
+
+ -- Temp : ... renames Expr; -- reference to a name
+ -- Temp : constant ... := Expr; -- all other cases
PV :=
Duplicate_Subexpr_No_Checks
(Exp => Exp,
Name_Req => False,
+ Renaming_Req => Is_Name_Reference (Exp),
Related_Id => Related_Id,
Is_Low_Bound => Is_Low_Bound,
Is_High_Bound => Is_High_Bound);