public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Fix small regression in -fdump-ada-spec
@ 2018-02-09  8:55 Eric Botcazou
  0 siblings, 0 replies; only message in thread
From: Eric Botcazou @ 2018-02-09  8:55 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 312 bytes --]

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.

-- 
Eric Botcazou

[-- Attachment #2: p.diff --]
[-- Type: text/x-patch, Size: 782 bytes --]

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-02-09  8:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-09  8:55 Fix small regression in -fdump-ada-spec Eric Botcazou

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).