]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
decl.c (make_implicit_typename): Handle case where t is not actually from context.
authorJason Merrill <jason@yorick.cygnus.com>
Thu, 20 Nov 1997 03:55:02 +0000 (03:55 +0000)
committerJason Merrill <jason@gcc.gnu.org>
Thu, 20 Nov 1997 03:55:02 +0000 (22:55 -0500)
* decl.c (make_implicit_typename): Handle case where t is not
  actually from context.
* tree.c (get_type_decl): Lose identifier case.
* spew.c (yylex): Lose useless call to identifer_typedecl_value.
* parse.y (nonnested_type): Just use lookup_name.
(complex_type_name): Just use IDENTIFIER_GLOBAL_VALUE.

From-SVN: r16588

gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/cp/parse.y
gcc/cp/spew.c
gcc/cp/tree.c

index 3d38c4d7605cc48ce97f295cef4f3ae93e32cbdd..1350bbac668f9a0424f2e3d0e835c0e975700c33 100644 (file)
@@ -1,3 +1,12 @@
+Wed Nov 19 18:24:14 1997  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * decl.c (make_implicit_typename): Handle case where t is not
+       actually from context.
+       * tree.c (get_type_decl): Lose identifier case.
+       * spew.c (yylex): Lose useless call to identifer_typedecl_value.
+       * parse.y (nonnested_type): Just use lookup_name.
+       (complex_type_name): Just use IDENTIFIER_GLOBAL_VALUE.
+
 Wed Nov 19 10:39:27 1997  Jason Merrill  <jason@yorick.cygnus.com>
 
        * decl.c (make_implicit_typename): New fn.
index 7a46a92d41667bb856251e3e63ed70aa878c7681..fc07dc7df6e7ceab3891eb35ab95cf3aec1156c8 100644 (file)
@@ -4389,7 +4389,7 @@ make_implicit_typename (context, t)
       && DECL_CONTEXT (t) != context)
     {
       tree binfo = get_binfo (DECL_CONTEXT (t), context, 0);
-      for (;;)
+      while (binfo)
        {
          tree next = BINFO_INHERITANCE_CHAIN (binfo);
          if (! uses_template_parms (BINFO_TYPE (next))
@@ -4397,7 +4397,11 @@ make_implicit_typename (context, t)
            break;
          binfo = next;
        }
-      retval = make_typename_type (BINFO_TYPE (binfo), DECL_NAME (t));
+      if (binfo)
+       retval = make_typename_type (BINFO_TYPE (binfo), DECL_NAME (t));
+      else
+       /* FIXME: find the enclosing class whose base t comes from.  */
+       retval = make_typename_type (DECL_CONTEXT (t), DECL_NAME (t));
     }
   else
     retval = make_typename_type (context, DECL_NAME (t));
index 0906947b73132c2c8df3a429b3d7ba3030a5a7e6..18d4aa74a9f1a4bae61f500998e2d24ecf0c68dc 100644 (file)
@@ -3017,18 +3017,15 @@ nonnested_type:
                {
                  if (TREE_CODE ($1) == IDENTIFIER_NODE)
                    {
+                     $$ = lookup_name ($1, 1);
                      if (current_class_type
                          && TYPE_BEING_DEFINED (current_class_type)
                          && ! IDENTIFIER_CLASS_VALUE ($1))
                        {
-                         /* Be sure to get an inherited typedef.  */
-                         $$ = lookup_name ($1, 1);
                          /* Remember that this name has been used in the class
                             definition, as per [class.scope0] */
                          pushdecl_class_level ($$);
                        }
-                     else
-                       $$ = identifier_typedecl_value ($1);
                    }
                  else
                    $$ = $1;
@@ -3036,7 +3033,7 @@ nonnested_type:
        | global_scope type_name
                {
                  if (TREE_CODE ($2) == IDENTIFIER_NODE)
-                   $$ = identifier_typedecl_value ($2);
+                   $$ = IDENTIFIER_GLOBAL_VALUE ($2);
                  else
                    $$ = $2;
                  got_scope = NULL_TREE;
@@ -3285,7 +3282,7 @@ complex_type_name:
          global_scope type_name
                {
                  if (TREE_CODE ($2) == IDENTIFIER_NODE)
-                   $$ = identifier_typedecl_value ($2);
+                   $$ = IDENTIFIER_GLOBAL_VALUE ($2);
                  else
                    $$ = $2;
                  got_scope = NULL_TREE;
index b8280a27fa19abf7136961280e2265710136397f..bed6e7b1330a68c42f6d10020a2c39378ef9304c 100644 (file)
@@ -310,9 +310,7 @@ yylex ()
            {
            case TYPENAME:
            case SELFNAME:
-             lastiddecl = identifier_typedecl_value (tmp_token.yylval.ttype);
-             if (lastiddecl != trrr)
-               lastiddecl = trrr;
+             lastiddecl = trrr;
              if (got_scope)
                tmp_token.yylval.ttype = trrr;
              break;
index e94fd554057d63c49623014824763493d7e88559..98b1a6d3b770e146a6eb742bccddaa6dcad9b4e7 100644 (file)
@@ -1866,8 +1866,6 @@ tree
 get_type_decl (t)
      tree t;
 {
-  if (TREE_CODE (t) == IDENTIFIER_NODE)
-    return identifier_typedecl_value (t);
   if (TREE_CODE (t) == TYPE_DECL)
     return t;
   if (TREE_CODE_CLASS (TREE_CODE (t)) == 't')