OSDN Git Service

* cp-tree.h: Add prototype for set_identifier_local_value.
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 24 Jul 1998 12:36:55 +0000 (12:36 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 24 Jul 1998 12:36:55 +0000 (12:36 +0000)
* decl.c (set_identifier_local_value_with_scope): Make static,
prototype.
* search.c (covariant_return_p): Likewise.
* except.c (build_terminate_handler, alloc_eh_object): Likewise.
* call.c (build_method_call): Only pull out the type of a destructor
if it's a template type parm.
* decl.c (lookup_name_real): Never return the from_obj value.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@21361 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/call.c
gcc/cp/cp-tree.h
gcc/cp/decl.c
gcc/cp/except.c
gcc/cp/search.c

index c580d55..ebf049e 100644 (file)
@@ -1,3 +1,15 @@
+1998-07-24  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * cp-tree.h: Add prototype for set_identifier_local_value.
+       * decl.c (set_identifier_local_value_with_scope): Make static,
+       prototype.
+       * search.c (covariant_return_p): Likewise.
+       * except.c (build_terminate_handler, alloc_eh_object): Likewise.
+
+       * call.c (build_method_call): Only pull out the type of a destructor
+       if it's a template type parm.
+       * decl.c (lookup_name_real): Never return the from_obj value.
+
 1998-07-23  Jason Merrill  <jason@yorick.cygnus.com>
 
        * except.c (process_start_catch_block_old): Call start_decl_1 for
index 3e11a74..936dcb6 100644 (file)
@@ -626,11 +626,13 @@ build_method_call (instance, name, parms, basetype_path, flags)
 
   if (processing_template_decl)
     {
+      /* We need to process template parm names here so that tsubst catches
+        them properly.  Other type names can wait.  */
       if (TREE_CODE (name) == BIT_NOT_EXPR
          && TREE_CODE (TREE_OPERAND (name, 0)) == IDENTIFIER_NODE)
        {
          tree type = get_aggr_from_typedef (TREE_OPERAND (name, 0), 0);
-         if (type)
+         if (type && TREE_CODE (type) == TEMPLATE_TYPE_PARM)
            name = build_min_nt (BIT_NOT_EXPR, type);
        }
 
index c433e7a..7572921 100644 (file)
@@ -2358,6 +2358,7 @@ extern void push_to_top_level                     PROTO((void));
 extern void pop_from_top_level                 PROTO((void));
 extern tree identifier_type_value              PROTO((tree));
 extern void set_identifier_type_value          PROTO((tree, tree));
+extern void set_identifier_local_value         PROTO((tree, tree));
 extern void pop_everything                     PROTO((void));
 extern void pushtag                            PROTO((tree, tree, int));
 extern tree make_anon_name                     PROTO((void));
index 87c2fd0..f25c700 100644 (file)
@@ -168,6 +168,8 @@ static tree lookup_tag PROTO((enum tree_code, tree,
                              struct binding_level *, int));
 static void set_identifier_type_value_with_scope
        PROTO((tree, tree, struct binding_level *));
+static void set_identifier_local_value_with_scope
+       PROTO((tree, tree, struct binding_level *));
 static void record_builtin_type PROTO((enum rid, char *, tree));
 static void record_unknown_type PROTO((tree, char *));
 static int member_function_or_else PROTO((tree, tree, char *));
@@ -2159,7 +2161,7 @@ set_identifier_type_value (id, type)
   set_identifier_type_value_with_scope (id, type, inner_binding_level);
 }
 
-void
+static void
 set_identifier_local_value_with_scope (id, val, b)
      tree id, val;
      struct binding_level *b;
@@ -5083,7 +5085,8 @@ lookup_name_real (name, prefer_type, nonclass, namespaces_only)
                          TREE_TYPE (val));
            }
 
-         val = from_obj;
+         /* We don't change val to from_obj here because that breaks
+            implicit typename for destructor calls.  */
        }
 
       if ((TREE_CODE (val) == TEMPLATE_DECL && looking_for_template)
index 0c26086..d294497 100644 (file)
@@ -59,6 +59,8 @@ static tree do_pop_exception PROTO((void));
 static void process_start_catch_block PROTO((tree, tree));
 static void process_start_catch_block_old PROTO((tree, tree));
 static tree build_eh_type_type_ref PROTO((tree));
+static tree build_terminate_handler PROTO((void));
+static tree alloc_eh_object PROTO((tree));
 
 #if 0
 /* This is the startup, and finish stuff per exception table.  */
@@ -556,7 +558,7 @@ push_eh_cleanup ()
 /* Build up a call to terminate on the function obstack, for use as an
    exception handler.  */
 
-tree
+static tree
 build_terminate_handler ()
 {
   int yes = suspend_momentary ();
@@ -1040,7 +1042,7 @@ end_anon_func ()
 
 /* Return a pointer to a buffer for an exception object of type TYPE.  */
 
-tree
+static tree
 alloc_eh_object (type)
      tree type;
 {
index ebd788a..bde0a29 100644 (file)
@@ -131,6 +131,7 @@ static void add_conversions PROTO((tree));
 static tree get_virtuals_named_this PROTO((tree));
 static tree get_virtual_destructor PROTO((tree, int));
 static int tree_has_any_destructor_p PROTO((tree, int));
+static int covariant_return_p PROTO((tree, tree));
 static struct search_level *push_search_level
        PROTO((struct stack_level *, struct obstack *));
 static struct search_level *pop_search_level
@@ -2163,7 +2164,7 @@ tree_has_any_destructor_p (binfo, i)
    Returns 1 if trivial covariance, 2 if non-trivial (requiring runtime
    adjustment), or -1 if pedantically invalid covariance.  */
 
-int
+static int
 covariant_return_p (brettype, drettype)
      tree brettype, drettype;
 {