This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Bug c++/11049] New: -fdump-class-hierarchy causes treechecking failure
- From: Diego Novillo <dnovillo at redhat dot com>
- To: gcc-bugzilla at gcc dot gnu dot org
- Cc: gcc-bugs at gcc dot gnu dot org, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: 31 May 2003 16:40:33 -0400
- Subject: Re: [Bug c++/11049] New: -fdump-class-hierarchy causes treechecking failure
- Organization: Red Hat Canada
- References: <20030531203043.11049.dhazeghi@yahoo.com>
This ought to fix this failure. It looks as an obvious fix to me. OK
to commit?
Diego.
* class.c (dump_array): Call CONSTRUCTOR_ELTS to access
the operand of a CONSTRUCTOR node.
Index: class.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/class.c,v
retrieving revision 1.541
diff -d -u -p -r1.541 class.c
--- class.c 20 May 2003 20:52:33 -0000 1.541
+++ class.c 31 May 2003 20:37:49 -0000
@@ -6671,7 +6671,7 @@ dump_array (FILE * stream, tree decl)
TFF_PLAIN_IDENTIFIER));
fprintf (stream, "\n");
- for (ix = 0, inits = TREE_OPERAND (DECL_INITIAL (decl), 1);
+ for (ix = 0, inits = CONSTRUCTOR_ELTS (DECL_INITIAL (decl));
inits; ix++, inits = TREE_CHAIN (inits))
fprintf (stream, "%-4ld %s\n", (long)(ix * elt),
expr_as_string (TREE_VALUE (inits), TFF_PLAIN_IDENTIFIER));