]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* class.c (resolve_address_of_overloaded_function): Don't
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 27 Apr 2011 15:56:56 +0000 (15:56 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 27 Apr 2011 15:56:56 +0000 (15:56 +0000)
change OVERLOAD to TREE_LIST.
* pt.c (print_candidates_1): Remove nonsensical assert.

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

gcc/cp/ChangeLog
gcc/cp/class.c
gcc/cp/pt.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.old-deja/g++.oliva/overload1.C

index 6873f64777765296b69744a49ee543ad94476118..349434f2fe96d3864d2485b32671e7b90dff9a99 100644 (file)
@@ -1,5 +1,9 @@
 2011-04-27  Jason Merrill  <jason@redhat.com>
 
+       * class.c (resolve_address_of_overloaded_function): Don't
+       change OVERLOAD to TREE_LIST.
+       * pt.c (print_candidates_1): Remove nonsensical assert.
+
        PR c++/48046
        * parser.c (cp_parser_diagnose_invalid_type_name): Commit
        to tentative parse sooner.
index fa5e00fcb1fd25cecf33336eaf2925540564f554..9af238b25e8d8700177e971ff82fea402cf7770d 100644 (file)
@@ -6514,14 +6514,7 @@ resolve_address_of_overloaded_function (tree target_type,
                 DECL_NAME (OVL_CURRENT (overload)),
                 target_type);
 
-         /* print_candidates expects a chain with the functions in
-            TREE_VALUE slots, so we cons one up here (we're losing anyway,
-            so why be clever?).  */
-         for (; overload; overload = OVL_NEXT (overload))
-           matches = tree_cons (NULL_TREE, OVL_CURRENT (overload),
-                                matches);
-
-         print_candidates (matches);
+         print_candidates (overload);
        }
       return error_mark_node;
     }
index de574a497e80fa77fd56f1af4d67337add314257..481306f5f7fd80e3ce41c890cd56437e1019dab4 100644 (file)
@@ -1706,7 +1706,6 @@ print_candidates_1 (tree fns, bool more, const char **str)
   for (fn = fns; fn; fn = OVL_NEXT (fn))
     if (TREE_CODE (fn) == TREE_LIST)
       {
-        gcc_assert (!OVL_NEXT (fn) && !is_overloaded_fn (fn));
         for (fn2 = fn; fn2 != NULL_TREE; fn2 = TREE_CHAIN (fn2))
           print_candidates_1 (TREE_VALUE (fn2),
                               TREE_CHAIN (fn2) || more, str);
@@ -1736,7 +1735,8 @@ print_candidates_1 (tree fns, bool more, const char **str)
     }
 }
 
-/* Print the list of candidate FNS in an error message.  */
+/* Print the list of candidate FNS in an error message.  FNS can also
+   be a TREE_LIST of non-functions in the case of an ambiguous lookup.  */
 
 void
 print_candidates (tree fns)
index 328d8dcbd7888424942cfaeade90d5703e473208..d851890835bebdcc527a42bb7a942c58cc137424 100644 (file)
@@ -1,5 +1,7 @@
 2011-04-27  Jason Merrill  <jason@redhat.com>
 
+       * g++.old-deja/g++.oliva/overload1.C: Adjust.
+
        * g++.dg/parse/ambig6.C: New.
 
 2011-04-27  Nick Clifton  <nickc@redhat.com>
index 91b3b02a439a654c57ae513ab037eda03114b887..75c8723c70f06d8dc3e0698109228cc15132b3a3 100644 (file)
@@ -6,7 +6,7 @@
 // Based on bug report by JDonner <jdonner@schedsys.com>
 
 struct foo {
-  static int bar(); // { dg-error "candidate" }
+  static int bar(); // { dg-error "foo::bar" }
   void bar(int); // { dg-error "foo::bar" }
 };