decl.c (make_implicit_typename): Handle case where t is not actually from context.
authorJason Merrill <jason@gcc.gnu.org>
Thu, 20 Nov 1997 04:07:26 +0000 (23:07 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Thu, 20 Nov 1997 04:07:26 +0000 (23:07 -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.

Wed Nov 19 11:45:07 1997  Michael Tiemann  <tiemann@axon.cygnus.com>

* error.c (dump_function_name): Test DECL_LANG_SPECIFIC in case
T was built in C language context (for example, by
output_func_start_profiler).

From-SVN: r16589

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

index efdf9a769e62ddb4e577e4660ae218c10e207ab1..f10aea4a7b487ed61493703b416d2b3591e81af3 100644 (file)
@@ -1,3 +1,18 @@
+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 11:45:07 1997  Michael Tiemann  <tiemann@axon.cygnus.com>
+
+       * error.c (dump_function_name): Test DECL_LANG_SPECIFIC in case
+       T was built in C language context (for example, by
+       output_func_start_profiler).
+
 Wed Nov 19 10:39:27 1997  Jason Merrill  <jason@yorick.cygnus.com>
 
        * decl.c (make_implicit_typename): New fn.
index e0158162e9dce01d6b7091b80a2d3fa2e49b23a4..3aa8201200afaaa5a26a2a55a38db90a3f5113ac 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 d6c6586b9ddccf7ad7fd8c16880e0fe35c8554b9..50421267ba05a2e7668772fd448813d5551f41ad 100644 (file)
@@ -925,7 +925,8 @@ dump_function_name (t)
   else
     dump_decl (name, 0);
 
-  if ((DECL_TEMPLATE_SPECIALIZATION (t) || DECL_IMPLICIT_INSTANTIATION (t))
+  if (DECL_LANG_SPECIFIC (t)
+      && (DECL_TEMPLATE_SPECIALIZATION (t) || DECL_IMPLICIT_INSTANTIATION (t))
       && (DECL_CLASS_CONTEXT (t) == NULL_TREE || is_member_template (t)))
     {
       tree args = DECL_TEMPLATE_INFO (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 ce884def14a085de1ea9a73bffbb6abdfeb7eff8..a6fe404bbe012b13ad6eaedae01e6e47f3ba4e4a 100644 (file)
@@ -312,9 +312,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')