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
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.
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;
}
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);
}
}
-/* 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)
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>
// 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" }
};