aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2011-04-27 11:56:56 -0400
committerJason Merrill <jason@gcc.gnu.org>2011-04-27 11:56:56 -0400
commitc224bdc1ee1b93c4a75b9927d9c961fb4a65131a (patch)
treed0be76a4429b9c32a6c02e886627781e4e1cfd62 /gcc
parent9e0541d9c0b2842b738a99a70673be0752ee591d (diff)
downloadgcc-c224bdc1ee1b93c4a75b9927d9c961fb4a65131a.zip
gcc-c224bdc1ee1b93c4a75b9927d9c961fb4a65131a.tar.gz
gcc-c224bdc1ee1b93c4a75b9927d9c961fb4a65131a.tar.bz2
class.c (resolve_address_of_overloaded_function): Don't change OVERLOAD to TREE_LIST.
* class.c (resolve_address_of_overloaded_function): Don't change OVERLOAD to TREE_LIST. * pt.c (print_candidates_1): Remove nonsensical assert. From-SVN: r173037
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/class.c9
-rw-r--r--gcc/cp/pt.c4
-rw-r--r--gcc/testsuite/ChangeLog2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.oliva/overload1.C2
5 files changed, 10 insertions, 11 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 6873f64..349434f 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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.
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index fa5e00f..9af238b 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -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;
}
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index de574a4..481306f 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -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)
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 328d8dc..d851890 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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>
diff --git a/gcc/testsuite/g++.old-deja/g++.oliva/overload1.C b/gcc/testsuite/g++.old-deja/g++.oliva/overload1.C
index 91b3b02..75c8723c 100644
--- a/gcc/testsuite/g++.old-deja/g++.oliva/overload1.C
+++ b/gcc/testsuite/g++.old-deja/g++.oliva/overload1.C
@@ -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" }
};