re PR c++/3394 (ICE in tree_low_cst, at tree.c:3462)
authorMumit Khan <khan@nanotech.wisc.edu>
Mon, 3 Dec 2001 12:50:36 +0000 (12:50 +0000)
committerCraig Rodrigues <rodrigc@gcc.gnu.org>
Mon, 3 Dec 2001 12:50:36 +0000 (12:50 +0000)
2001-12-03  Mumit Khan  <khan@nanotech.wisc.edu>

        PR c++/3394
        *  decl.c (xref_basetypes): Handle attributes between
          'class' and name.

From-SVN: r47547

gcc/cp/ChangeLog
gcc/cp/decl.c

index 6b970756d4a4ea3473a4715062cdf78b121920cf..52763df55adb5f9d255fdcf0bc402c83e52c1bae 100644 (file)
@@ -1,3 +1,9 @@
+2001-12-03  Mumit Khan  <khan@nanotech.wisc.edu>
+
+       PR c++/3394
+       *  decl.c (xref_basetypes): Handle attributes between 
+         'class' and name.
+
 2001-12-03  Nathan Sidwell  <nathan@codesourcery.com>
 
        PR g++/3381
index c10a0c7c1c70f900a110a35d9621e7aa0de114be..74e829abd613bb5ec4ca66a0e767e9b60b241333 100644 (file)
@@ -12849,6 +12849,14 @@ xref_basetypes (code_type_node, name, ref, binfo)
   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)