[multiple changes]
authorArnaud Charlet <charlet@gcc.gnu.org>
Fri, 28 Apr 2017 13:34:44 +0000 (15:34 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Fri, 28 Apr 2017 13:34:44 +0000 (15:34 +0200)
2017-04-28  Gary Dismukes  <dismukes@adacore.com>

* 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  <charlet@adacore.com>

* a-cforse.adb: minor style fix in comment.

From-SVN: r247386

gcc/ada/ChangeLog
gcc/ada/a-cforse.adb
gcc/ada/sem_util.adb

index af97683..6126ee7 100644 (file)
@@ -1,3 +1,14 @@
+2017-04-28  Gary Dismukes  <dismukes@adacore.com>
+
+       * 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  <charlet@adacore.com>
+
+       * a-cforse.adb: minor style fix in comment.
+
 2017-04-28  Eric Botcazou  <ebotcazou@adacore.com>
 
        * exp_ch9.adb (Build_Lock_Free_Unprotected_Subprogram_Body): Also
index b386c52..6c7f8e4 100644 (file)
@@ -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
index 41f6f16..7a50fd2 100644 (file)
@@ -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