diff mbox series

Fix small regression in -fdump-ada-spec

Message ID 3583644.mhZvfOyiAA@polaris
State New
Headers show
Series Fix small regression in -fdump-ada-spec | expand

Commit Message

Eric Botcazou Feb. 9, 2018, 8:55 a.m. UTC
We cannot generate the 'constant' keyword for components in Ada, it's illegal.

Tested on x86_64-suse-linux, applied on the mainline.


2018-02-09  Eric Botcazou  <ebotcazou@adacore.com>

c-family/
	* c-ada-spec.c (dump_ada_declaration): Do not generate the 'constant'
	keyword for components.
diff mbox series

Patch

Index: c-family/c-ada-spec.c
===================================================================
--- c-family/c-ada-spec.c	(revision 257404)
+++ c-family/c-ada-spec.c	(working copy)
@@ -3131,7 +3131,7 @@  dump_ada_declaration (pretty_printer *bu
 	    {
 	      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 *bu
 		      || 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