aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMumit Khan <khan@nanotech.wisc.edu>2001-12-03 12:50:36 +0000
committerCraig Rodrigues <rodrigc@gcc.gnu.org>2001-12-03 12:50:36 +0000
commita5d7c4a3db93ea99d42d45b679c91b0336627e03 (patch)
treec782ccda533cf65970dbbc56cbd908545cab242d
parentf1880e134cfdc12afecb48cb345bad896bbdf318 (diff)
downloadgcc-a5d7c4a3db93ea99d42d45b679c91b0336627e03.zip
gcc-a5d7c4a3db93ea99d42d45b679c91b0336627e03.tar.gz
gcc-a5d7c4a3db93ea99d42d45b679c91b0336627e03.tar.bz2
re PR c++/3394 (ICE in tree_low_cst, at tree.c:3462)
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
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/decl.c8
2 files changed, 14 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 6b97075..52763df 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index c10a0c7..74e829a 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -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)