diff options
author | Jakub Jelinek <jakub@redhat.com> | 2019-11-20 09:33:56 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2019-11-20 09:33:56 +0100 |
commit | ee686729283500c330b8b920f4f8e4dcc566adde (patch) | |
tree | 749ac663fb4f1550f1ed8d1ac5b9e3376f97a7cb /gcc/cp | |
parent | d742b0c1a02aab7fa61b6d89eecee81b298f06c6 (diff) | |
download | gcc-ee686729283500c330b8b920f4f8e4dcc566adde.zip gcc-ee686729283500c330b8b920f4f8e4dcc566adde.tar.gz gcc-ee686729283500c330b8b920f4f8e4dcc566adde.tar.bz2 |
re PR c++/90767 (jumbled error message with this and const)
PR c++/90767
* call.c (complain_about_no_candidates_for_method_call): If
conv->from is not a type, pass to complain_about_bad_argument
lvalue_type of conv->from.
* g++.dg/diagnostic/pr90767-1.C: New test.
* g++.dg/diagnostic/pr90767-2.C: New test.
From-SVN: r278484
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/cp/call.c | 5 |
2 files changed, 11 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 34af32c..6031acf 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +2019-11-20 Jakub Jelinek <jakub@redhat.com> + + PR c++/90767 + * call.c (complain_about_no_candidates_for_method_call): If + conv->from is not a type, pass to complain_about_bad_argument + lvalue_type of conv->from. + 2019-11-20 Paolo Carlini <paolo.carlini@oracle.com> * cvt.c (ocp_convert): Use additional warning sentinel. diff --git a/gcc/cp/call.c b/gcc/cp/call.c index f4dfa7b..cccb90f 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -9871,8 +9871,11 @@ complain_about_no_candidates_for_method_call (tree instance, if (const conversion_info *conv = maybe_get_bad_conversion_for_unmatched_call (candidate)) { + tree from_type = conv->from; + if (!TYPE_P (conv->from)) + from_type = lvalue_type (conv->from); complain_about_bad_argument (conv->loc, - conv->from, conv->to_type, + from_type, conv->to_type, candidate->fn, conv->n_arg); return; } |