]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
lex.c (do_identifier): Look for class value even if we don't have a global value.
authorJason Merrill <jason@gcc.gnu.org>
Mon, 20 Jul 1998 00:19:21 +0000 (20:19 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Mon, 20 Jul 1998 00:19:21 +0000 (20:19 -0400)
* lex.c (do_identifier): Look for class value even if we don't
have a global value.  Do implicit declaration if parsing is 2.
* semantics.c (finish_call_expr): Pass 2 if we're doing Koenig
lookup.
* decl.c (pushtag): Revert previous change.
* pt.c (lookup_template_class): Don't put out debugging
information for types that use template parameters.
* decl.c (pushtag): Don't put out debugging information for
compiler-generated typedefs.
* error.c (dump_type_real): Don't crash when presented with
intQI_type_node or the like.
* semantics.c (finish_translation_unit): Fix spelling error in
comment.

From-SVN: r21299

gcc/cp/ChangeLog
gcc/cp/error.c
gcc/cp/lex.c
gcc/cp/pt.c
gcc/cp/semantics.c

index df8356d5e2ecdc67a09543f491603519a65a3d2e..bb79eeaff514209baf53341a6215727b95b96010 100644 (file)
@@ -1,3 +1,25 @@
+1998-07-19  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * lex.c (do_identifier): Look for class value even if we don't
+       have a global value.  Do implicit declaration if parsing is 2.
+       * semantics.c (finish_call_expr): Pass 2 if we're doing Koenig
+       lookup.
+
+1998-07-19  Mark Mitchell  <mark@markmitchell.com>
+
+       * decl.c (pushtag): Revert previous change.
+       * pt.c (lookup_template_class): Don't put out debugging
+       information for types that use template parameters.
+
+       * decl.c (pushtag): Don't put out debugging information for
+       compiler-generated typedefs.
+       
+       * error.c (dump_type_real): Don't crash when presented with
+       intQI_type_node or the like.
+
+       * semantics.c (finish_translation_unit): Fix spelling error in
+       comment.
+
 1998-07-17  Jason Merrill  <jason@yorick.cygnus.com>
 
        * decl.c (lookup_name_real): Pull out single function here.
index d4dc054c970c8acee55c6393bac223bcd484966a..bb21bcb5021c7420761af2e21d708490f76c10ce 100644 (file)
@@ -229,8 +229,18 @@ dump_type_real (t, v, canonical_name)
     case REAL_TYPE:
     case VOID_TYPE:
     case BOOLEAN_TYPE:
-      dump_readonly_or_volatile (t, after);
-      OB_PUTID (TYPE_IDENTIFIER (canonical_name ? TYPE_MAIN_VARIANT (t) : t));
+      {
+       tree type;
+       dump_readonly_or_volatile (t, after);
+       type = canonical_name ? TYPE_MAIN_VARIANT (t) : t;
+       if (TYPE_NAME (type) && TYPE_IDENTIFIER (type))
+         OB_PUTID (TYPE_IDENTIFIER (type));
+       else
+         /* Types like intQI_type_node and friends have no names.
+            These don't come up in user error messages, but it's nice
+            to be able to print them from the debugger.  */
+         OB_PUTS ("{anonymous}");
+      }
       break;
 
     case TEMPLATE_TEMPLATE_PARM:
index 8573a8543fe53b1363317bd934898ec9f4fd2100..57639adfdeb49169ab799f9737db336569faa4b1 100644 (file)
@@ -2817,17 +2817,17 @@ do_identifier (token, parsing, args)
      tree args;
 {
   register tree id;
+  int lexing = (parsing == 1);
+  int in_call = (parsing == 2);
 
-  if (! parsing || IDENTIFIER_OPNAME_P (token))
+  if (! lexing || IDENTIFIER_OPNAME_P (token))
     id = lookup_name (token, 0);
   else
     id = lastiddecl;
 
-  if (parsing && yychar == YYEMPTY)
-    yychar = yylex ();
   /* Scope class declarations before global
      declarations.  */
-  if (id && is_global (id)
+  if ((!id || is_global (id))
       && current_class_type != 0
       && TYPE_SIZE (current_class_type) == 0)
     {
@@ -2894,7 +2894,7 @@ do_identifier (token, parsing, args)
            cp_error ("`%D' not defined", token);
          id = error_mark_node;
        }
-      else if (parsing && (yychar == '(' || yychar == LEFT_RIGHT))
+      else if (in_call)
        {
          id = implicitly_declare (token);
        }
index ed23223d664efbc9251bfebb3096da162acf6698..0f1dbdd8662e8a7ea453eea805a856adde095baa 100644 (file)
@@ -3212,6 +3212,11 @@ lookup_template_class (d1, arglist, in_decl, context)
          && CLASSTYPE_INTERFACE_KNOWN (TREE_TYPE (template))
          && ! CLASSTYPE_INTERFACE_ONLY (TREE_TYPE (template)))
        add_pending_template (t);
+
+      if (uses_template_parms (arglist))
+       /* If the type makes use of template parameters, the
+          code that generates debugging information will crash.  */
+       DECL_IGNORED_P (TYPE_STUB_DECL (t)) = 1;
     }
 
   return t;
index 206840e2cf115ad3fdee3b155a95553b1b549562..50685129e08fdf4d63e5ea96bde2a368cd7a518e 100644 (file)
@@ -848,7 +848,7 @@ finish_call_expr (fn, args, koenig)
       if (TREE_CODE (fn) == BIT_NOT_EXPR)
        fn = build_x_unary_op (BIT_NOT_EXPR, TREE_OPERAND (fn, 0));
       else if (TREE_CODE (fn) != TEMPLATE_ID_EXPR)
-       fn = do_identifier (fn, 0, args);
+       fn = do_identifier (fn, 2, args);
     }
   result = build_x_function_call (fn, args, current_class_ref);
 
@@ -1135,7 +1135,7 @@ finish_declarator (declarator, declspecs, attributes,
                     prefix_attributes); 
 }
 
-/* Finish a transltation unit.  */
+/* Finish a translation unit.  */
 
 void 
 finish_translation_unit ()