This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

c++/3394 patch: attribute between class and name of derived classes


Testcase in gnats, and so is this patch.

2001-06-24  Mumit Khan  <khan@nanotech.wisc.edu>

	* decl.c (xref_basetypes): Handle attributes between 'class' and 
	name.

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)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]