semantics.c (begin_class_definition): Call build_self_reference.
authorMark Mitchell <mark@markmitchell.com>
Wed, 10 Mar 1999 17:58:08 +0000 (17:58 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Wed, 10 Mar 1999 17:58:08 +0000 (17:58 +0000)
* semantics.c (begin_class_definition): Call build_self_reference.
(finish_member_declaration): Set DECL_CONTEXT for TYPE_DECLs.

From-SVN: r25672

gcc/cp/ChangeLog
gcc/cp/semantics.c

index d1c731c23cd0582b02ad6a781ea23fdda9448da7..2c7eace4e641c7c919aa0e612dcbc9248c61766a 100644 (file)
@@ -1,5 +1,8 @@
 1999-03-10  Mark Mitchell  <mark@markmitchell.com>
 
+       * semantics.c (begin_class_definition): Call build_self_reference.
+       (finish_member_declaration): Set DECL_CONTEXT for TYPE_DECLs.
+
        * search.c (assert_canonical_unmarked): Fix typo in prototype.
 
        * search.c (dfs_canonical_queue): New function.
index 076197a70c8f75d6745c0f06294e814dbe8a0488..6471fd15866f43f27be49a1a783b3294c496becb 100644 (file)
@@ -1327,6 +1327,9 @@ begin_class_definition (t)
      that we can get it back later.  */
   begin_tree ();
 
+  /* Make a declaration for this class in its own scope.  */
+  build_self_reference ();
+
   return t;
 }
 
@@ -1365,11 +1368,6 @@ finish_member_declaration (decl)
        finish_struct.  Presumably it is already set as the function is
        parsed.  Perhaps DECL_CLASS_CONTEXT is already set, too?  */
     DECL_CLASS_CONTEXT (decl) = current_class_type;
-  else if (TREE_CODE (decl) == TYPE_DECL)
-    /* Historically, DECL_CONTEXT was not set for a TYPE_DECL in
-       finish_struct, so we do not do it here either.  Perhaps we
-       should, though.  */
-      ;
   else
     DECL_CONTEXT (decl) = current_class_type;