From 99f8abb6afb37c687776b61eedd8fd6b62c71b76 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Fri, 28 Apr 2017 15:34:44 +0200 Subject: [PATCH] [multiple changes] 2017-04-28 Gary Dismukes * sem_util.adb (Is_Dependent_Component_Of_Mutable_Object): Test Relaxed_RM_Semantics to avoid having CodePeer issue errors on code that might violate the more stringent checking for 'Access introduced in Ada 2005. 2017-04-28 Arnaud Charlet * a-cforse.adb: minor style fix in comment. From-SVN: r247386 --- gcc/ada/ChangeLog | 11 +++++++++++ gcc/ada/a-cforse.adb | 2 +- gcc/ada/sem_util.adb | 14 +++++++++----- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index af976831dab..6126ee70623 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,14 @@ +2017-04-28 Gary Dismukes + + * sem_util.adb (Is_Dependent_Component_Of_Mutable_Object): Test + Relaxed_RM_Semantics to avoid having CodePeer issue errors on + code that might violate the more stringent checking for 'Access + introduced in Ada 2005. + +2017-04-28 Arnaud Charlet + + * a-cforse.adb: minor style fix in comment. + 2017-04-28 Eric Botcazou * exp_ch9.adb (Build_Lock_Free_Unprotected_Subprogram_Body): Also diff --git a/gcc/ada/a-cforse.adb b/gcc/ada/a-cforse.adb index b386c5243ba..6c7f8e45282 100644 --- a/gcc/ada/a-cforse.adb +++ b/gcc/ada/a-cforse.adb @@ -251,7 +251,7 @@ is Node => Target_Node); end Append_Element; - -- Start of processing for Assign + -- Start of processing for Assign begin if Target'Address = Source'Address then diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 41f6f16a0b8..7a50fd2ba48 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -12883,11 +12883,15 @@ package body Sem_Util is -- unconstrained aliased object, whereas in Ada 95 the designated -- object is guaranteed to be constrained. A worst-case assumption -- has to apply in Ada 2005 because we can't tell at compile - -- time whether the object is "constrained by its initial value" - -- (despite the fact that 3.10.2(26/2) and 8.5.1(5/2) are semantic - -- rules (these rules are acknowledged to need fixing). - - if Ada_Version < Ada_2005 then + -- time whether the object is "constrained by its initial value", + -- despite the fact that 3.10.2(26/2) and 8.5.1(5/2) are semantic + -- rules (these rules are acknowledged to need fixing). We don't + -- impose this more stringent checking for earlier Ada versions or + -- when Relaxed_RM_Semantics applies (the latter for CodePeer's + -- benefit, though it's unclear on why using -gnat95 would not be + -- sufficient???). + + if Ada_Version < Ada_2005 or else Relaxed_RM_Semantics then if Is_Access_Type (Prefix_Type) or else Nkind (P) = N_Explicit_Dereference then -- 2.30.2