aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2000-06-26 11:06:39 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2000-06-26 11:06:39 +0000
commit0404d86f340f43e55c2a62a59462311fbaef3d57 (patch)
tree93b1bd181a6273d3dcdecedf9ce36577c5a5a211 /gcc
parent24b55e3aa0c2e66981dce528f105e7a21f89d3df (diff)
downloadgcc-0404d86f340f43e55c2a62a59462311fbaef3d57.zip
gcc-0404d86f340f43e55c2a62a59462311fbaef3d57.tar.gz
gcc-0404d86f340f43e55c2a62a59462311fbaef3d57.tar.bz2
decl2.c (handle_class_head): Bash typedefs to the type's main decl.
* decl2.c (handle_class_head): Bash typedefs to the type's main decl. From-SVN: r34707
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/decl2.c4
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 854eb8f..6046799 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2000-06-26 Nathan Sidwell <nathan@codesourcery.com>
+
+ * decl2.c (handle_class_head): Bash typedefs to the type's main
+ decl.
+
2000-06-25 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (genrtl_begin_stmt_expr): Rename to ...
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 8fe160e..af29ae0 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -5362,7 +5362,9 @@ handle_class_head (aggr, scope, id)
tree decl;
if (TREE_CODE (id) == TYPE_DECL)
- decl = id;
+ /* We must bash typedefs back to the main decl of the type. Otherwise
+ we become confused about scopes. */
+ decl = TYPE_MAIN_DECL (TREE_TYPE (id));
else if (DECL_CLASS_TEMPLATE_P (id))
decl = DECL_TEMPLATE_RESULT (id);
else