OSDN Git Service

* tree.c (get_fns): Split out from get_first_fn.
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 27 Apr 2010 21:35:17 +0000 (21:35 +0000)
committerMasaki Muranaka <monaka@monami-software.com>
Sun, 23 May 2010 05:36:40 +0000 (14:36 +0900)
* cp-tree.h: Declare it.
* search.c (shared_member_p): Use it.
* semantics.c (finish_qualified_id_expr): Simplify.
(finish_id_expression): Simplify.

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

gcc/cp/ChangeLog
gcc/cp/semantics.c

index d43f683..1b5ea4b 100644 (file)
@@ -1,4 +1,10 @@
-2010-04-27  Jason Merrill  <jason@redhat.com>
+2010-04-24  Jason Merrill  <jason@redhat.com>
+
+       * tree.c (get_fns): Split out from get_first_fn.
+       * cp-tree.h: Declare it.
+       * search.c (shared_member_p): Use it.
+       * semantics.c (finish_qualified_id_expr): Simplify.
+       (finish_id_expression): Simplify.
 
        * semantics.c (finish_non_static_data_member): Call maybe_dummy_object
        whenever object is NULL_TREE.  Don't do 'this' capture here.
 
        * semantics.c (finish_non_static_data_member): Call maybe_dummy_object
        whenever object is NULL_TREE.  Don't do 'this' capture here.
index 73fed15..d4ce014 100644 (file)
@@ -1662,15 +1662,11 @@ finish_qualified_id_expr (tree qualifying_class,
     }
   else if (BASELINK_P (expr) && !processing_template_decl)
     {
     }
   else if (BASELINK_P (expr) && !processing_template_decl)
     {
-      tree fns;
       tree ob;
 
       /* See if any of the functions are non-static members.  */
       tree ob;
 
       /* See if any of the functions are non-static members.  */
-      fns = BASELINK_FUNCTIONS (expr);
-      if (TREE_CODE (fns) == TEMPLATE_ID_EXPR)
-       fns = TREE_OPERAND (fns, 0);
       /* If so, the expression may be relative to 'this'.  */
       /* If so, the expression may be relative to 'this'.  */
-      if (!shared_member_p (fns)
+      if (!shared_member_p (expr)
          && (ob = maybe_dummy_object (qualifying_class, NULL),
              !is_dummy_object (ob)))
        expr = (build_class_member_access_expr
          && (ob = maybe_dummy_object (qualifying_class, NULL),
              !is_dummy_object (ob)))
        expr = (build_class_member_access_expr
@@ -3124,10 +3120,7 @@ finish_id_expression (tree id_expression,
        {
          tree first_fn;
 
        {
          tree first_fn;
 
-         first_fn = decl;
-         if (TREE_CODE (first_fn) == TEMPLATE_ID_EXPR)
-           first_fn = TREE_OPERAND (first_fn, 0);
-         first_fn = get_first_fn (first_fn);
+         first_fn = get_first_fn (decl);
          if (TREE_CODE (first_fn) == TEMPLATE_DECL)
            first_fn = DECL_TEMPLATE_RESULT (first_fn);
 
          if (TREE_CODE (first_fn) == TEMPLATE_DECL)
            first_fn = DECL_TEMPLATE_RESULT (first_fn);