This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/3394
- To: gcc-gnats at gcc dot gnu dot org
- Subject: Re: c++/3394
- From: Craig Rodrigues <rodrigc at mediaone dot net>
- Date: Thu, 12 Jul 2001 08:14:41 -0400
- Cc: gcc-prs at gcc dot gnu dot org, khan at nanotech dot wisc dot edu, rodrigc at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=3394&database=gcc
Mumit Khan <khan@nanotech.wisc.edu> has provided the following
patch to solve the problem described in PR 3394:
Index: gcc/cp/decl.c
===================================================================
RCS file: /homes/khan/src/win32/cygwin/CVSROOT/gcc-3.0/gcc/cp/decl.c,v
retrieving revision 1.2
diff -u -3 -p -r1.2 decl.c
--- gcc/cp/decl.c 2001/06/21 04:44:06 1.2
+++ gcc/cp/decl.c 2001/06/22 15:15:12
@@ -12765,6 +12765,14 @@ xref_basetypes (code_type_node, name, re
tree base;
int i, len;
+
+ /* If we are called from the parser, code_type_node will sometimes be a
+ TREE_LIST. This indicates that the user wrote
+ "class __attribute__ ((foo)) bar". Extract the attributes so that
+ tree_low_cst doesn't crash. */
+ if (TREE_CODE (code_type_node) == TREE_LIST)
+ code_type_node = TREE_VALUE (code_type_node);
+
enum tag_types tag_code = (enum tag_types) tree_low_cst (code_type_node, 1);
if (tag_code == union_type)
--
Craig Rodrigues
http://www.gis.net/~craigr
rodrigc@mediaone.net