]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* 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)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 27 Apr 2010 21:35:17 +0000 (21:35 +0000)
* 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/cp-tree.h
gcc/cp/search.c
gcc/cp/semantics.c
gcc/cp/tree.c

index f19d06f9dc60df0667dfb33cfad6f6275e663c95..08746bae335963f4c612975b8aad473384d168d7 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.
index 62e92cc81c76ae4b3437982ecfc6d38b08d43b90..cbb1ac65315cec6aad33cf846664805059e9a11f 100644 (file)
@@ -5259,6 +5259,7 @@ extern tree hash_tree_cons                        (tree, tree, tree);
 extern tree hash_tree_chain                    (tree, tree);
 extern tree build_qualified_name               (tree, tree, tree, bool);
 extern int is_overloaded_fn                    (tree);
+extern tree get_fns                            (tree);
 extern tree get_first_fn                       (tree);
 extern tree ovl_cons                           (tree, tree);
 extern tree build_overload                     (tree, tree);
index 772ae3b1fbe8074ce2cdea083aee301d46fe7241..11011e7f3347e229bcca283a946aac3f226697c3 100644 (file)
@@ -973,6 +973,7 @@ shared_member_p (tree t)
     return 1;
   if (is_overloaded_fn (t))
     {
+      t = get_fns (t);
       for (; t; t = OVL_NEXT (t))
        {
          tree fn = OVL_CURRENT (t);
index 73fed1538017ddebe5f4f4b2d9ab40a549a6505f..d4ce01496ee0e7783d3d739b3b67ec091276aa5b 100644 (file)
@@ -1662,15 +1662,11 @@ finish_qualified_id_expr (tree qualifying_class,
     }
   else if (BASELINK_P (expr) && !processing_template_decl)
     {
-      tree fns;
       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 (!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
@@ -3124,10 +3120,7 @@ finish_id_expression (tree id_expression,
        {
          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);
 
index f8b2c403af4df2536c4d9b6308343417cc333d42..4d25cac186c565aa01be7553dc3e0dbadd8fa0b5 100644 (file)
@@ -1352,7 +1352,7 @@ really_overloaded_fn (tree x)
 }
 
 tree
-get_first_fn (tree from)
+get_fns (tree from)
 {
   gcc_assert (is_overloaded_fn (from));
   /* A baselink is also considered an overloaded function.  */
@@ -1363,7 +1363,13 @@ get_first_fn (tree from)
     from = BASELINK_FUNCTIONS (from);
   if (TREE_CODE (from) == TEMPLATE_ID_EXPR)
     from = TREE_OPERAND (from, 0);
-  return OVL_CURRENT (from);
+  return from;
+}
+
+tree
+get_first_fn (tree from)
+{
+  return OVL_CURRENT (get_fns (from));
 }
 
 /* Return a new OVL node, concatenating it with the old one.  */