c-ada-spec.c (dump_ada_declaration): Do not generate the 'constant' keyword for compo...
authorEric Botcazou <ebotcazou@adacore.com>
Fri, 9 Feb 2018 08:54:54 +0000 (08:54 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Fri, 9 Feb 2018 08:54:54 +0000 (08:54 +0000)
* c-ada-spec.c (dump_ada_declaration): Do not generate the 'constant'
keyword for components.

From-SVN: r257517

gcc/c-family/ChangeLog
gcc/c-family/c-ada-spec.c

index 02b2b1ab9ee537e675718987383ed23ee394afe7..881df2c3e22f7c06846f4570f08037272ce6d5bc 100644 (file)
@@ -1,3 +1,8 @@
+2018-02-09  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * c-ada-spec.c (dump_ada_declaration): Do not generate the 'constant'
+       keyword for components.
+
 2018-02-02  Paolo Carlini  <paolo.carlini@oracle.com>
 
        * c-common.h (DECL_UNNAMED_BIT_FIELD): New.
index 914ded9efc9a89f447f0010bb0b71e979ff52af1..1c1cadc54f598c97479c3116fd765a04e8252819 100644 (file)
@@ -3131,7 +3131,7 @@ dump_ada_declaration (pretty_printer *buffer, tree t, tree type, int spc)
            {
              pp_string (buffer, "aliased ");
 
-             if (TREE_READONLY (t))
+             if (TREE_READONLY (t) && TREE_CODE (t) != FIELD_DECL)
                pp_string (buffer, "constant ");
 
              if (TYPE_NAME (TREE_TYPE (t)))
@@ -3147,7 +3147,7 @@ dump_ada_declaration (pretty_printer *buffer, tree t, tree type, int spc)
                      || TREE_CODE (TREE_TYPE (t)) != INTEGER_TYPE))
                pp_string (buffer, "aliased ");
 
-             if (TREE_READONLY (t))
+             if (TREE_READONLY (t) && TREE_CODE (t) != FIELD_DECL)
                pp_string (buffer, "constant ");
 
              dump_generic_ada_node