OSDN Git Service

91th Cygnus<->FSF merge
[pf3gnuchains/gcc-fork.git] / gcc / cp / lex.c
index a34e4f0..befb5a1 100644 (file)
@@ -271,7 +271,7 @@ char *token_buffer;         /* Pointer to token buffer.
 
 #include "hash.h"
 \f
-int check_newline ();
+static int check_newline ();
 
 /* Nonzero tells yylex to ignore \ in string constants.  */
 static int ignore_escape_flag = 0;
@@ -392,12 +392,14 @@ init_filename_times ()
    Stuck this hack in to get the files open correctly; this is called
    in place of init_lex if we are an unexec'd binary.    */
 
+#if 0
 void
 reinit_lang_specific ()
 {
   init_filename_times ();
   reinit_search_statistics ();
 }
+#endif
 
 int *init_parse ();
 
@@ -1091,7 +1093,7 @@ interface_strcmp (s)
   return 1;
 }
 
-void
+static void
 set_typedecl_interface_info (prev, vars)
      tree prev, vars;
 {
@@ -1103,7 +1105,7 @@ set_typedecl_interface_info (prev, vars)
     = interface_strcmp (FILE_NAME_NONDIRECTORY (DECL_SOURCE_FILE (vars)));
 }
 
-int
+static int
 set_vardecl_interface_info (prev, vars)
      tree prev, vars;
 {
@@ -1403,7 +1405,7 @@ store_pending_inline (decl, t)
   pending_inlines = t;
 }
 
-void reinit_parse_for_block ();
+static void reinit_parse_for_block PROTO((int, struct obstack *));
 
 void
 reinit_parse_for_method (yychar, decl)
@@ -1455,7 +1457,7 @@ reinit_parse_for_method (yychar, decl)
 /* Consume a block -- actually, a method beginning
    with `:' or `{' -- and save it away on the specified obstack.  */
 
-void
+static void
 reinit_parse_for_block (pyychar, obstackp)
      int pyychar;
      struct obstack *obstackp;
@@ -1671,12 +1673,13 @@ cons_up_default_function (type, full_name, kind)
       break;
 
     case 5:
-      type = build_type_variant (type, 1, 0);
-      /* Fall through...  */
     case 6:
       retref = 1;
       declspecs = build_decl_list (NULL_TREE, type);
 
+      if (kind == 5)
+       type = build_type_variant (type, 1, 0);
+
       name = ansi_opname [(int) MODIFY_EXPR];
 
       argtype = build_reference_type (type);
@@ -1894,9 +1897,12 @@ get_last_nonwhite_on_line ()
 
 int linemode;
 
-int handle_cp_pragma ();
+#ifdef HANDLE_SYSV_PRAGMA
+static int handle_sysv_pragma ();
+#endif
+static int handle_cp_pragma ();
 
-int
+static int
 check_newline ()
 {
   register int c;
@@ -2513,7 +2519,12 @@ do_identifier (token, parsing)
      [class.scope0] */
   if (id && current_class_type && parsing
       && TYPE_BEING_DEFINED (current_class_type)
-      && ! IDENTIFIER_CLASS_VALUE (token))
+      && ! IDENTIFIER_CLASS_VALUE (token)
+      /* Avoid breaking if we get called for a default argument that
+        refers to an overloaded method.  Eventually this will not be
+        necessary, since default arguments shouldn't be parsed until
+        after the class is complete.  (jason 3/12/97) */
+      && TREE_CODE (id) != TREE_LIST)
     pushdecl_class_level (id);
     
   if (!id || id == error_mark_node)
@@ -3005,18 +3016,6 @@ real_yylex ()
        /* If we did not find a keyword, look for an identifier
           (or a typename).  */
 
-       if (strcmp ("catch", token_buffer) == 0
-           || strcmp ("throw", token_buffer) == 0
-           || strcmp ("try", token_buffer) == 0)
-         {
-           static int did_warn = 0;
-           if (! did_warn  && ! flag_exceptions)
-             {
-               pedwarn ("`catch', `throw', and `try' are all C++ reserved words");
-               did_warn = 1;
-             }
-         }
-
        if (value == IDENTIFIER || value == TYPESPEC)
          GNU_xref_ref (current_function_decl, token_buffer);
 
@@ -4166,33 +4165,6 @@ make_lang_type (code)
 }
 
 void
-copy_decl_lang_specific (decl)
-     tree decl;
-{
-  extern struct obstack *current_obstack, *saveable_obstack;
-  register int *old = (int *)DECL_LANG_SPECIFIC (decl);
-  struct obstack *obstack = current_obstack;
-  register int i = sizeof (struct lang_decl) / sizeof (int);
-  register int *pi;
-
-  if (! TREE_PERMANENT (decl))
-    obstack = saveable_obstack;
-  else
-    my_friendly_assert (obstack == &permanent_obstack, 237);
-
-  pi = (int *) obstack_alloc (obstack, sizeof (struct lang_decl));
-  while (i-- > 0)
-    pi[i] = old[i];
-
-  DECL_LANG_SPECIFIC (decl) = (struct lang_decl *) pi;
-
-#ifdef GATHER_STATISTICS
-  tree_node_counts[(int)lang_decl] += 1;
-  tree_node_sizes[(int)lang_decl] += sizeof (struct lang_decl);
-#endif
-}
-
-void
 dump_time_statistics ()
 {
   register tree prev = 0, decl, next;
@@ -4259,7 +4231,7 @@ yyerror (string)
   error (buf, token_buffer);
 }
 \f
-int
+static int
 handle_cp_pragma (pname)
      char *pname;
 {
@@ -4444,7 +4416,7 @@ handle_cp_pragma (pname)
 /* This function has to be in this file, in order to get at
    the token types.  */
 
-int
+static int
 handle_sysv_pragma (finput, token)
      FILE *finput;
      register int token;