aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/call.c
diff options
context:
space:
mode:
authorManuel López-Ibáñez <manu@gcc.gnu.org>2015-06-03 19:23:20 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2015-06-03 19:23:20 +0000
commitd3ea4c064f6e6370eb791985fef4acdd5fb1b833 (patch)
tree8c52823d6a36b1409914c63e7e541f67d8c6a56d /gcc/cp/call.c
parent4753e009664aa5d4cdf0ce86a03224f5bc1f9d7b (diff)
downloadgcc-d3ea4c064f6e6370eb791985fef4acdd5fb1b833.zip
gcc-d3ea4c064f6e6370eb791985fef4acdd5fb1b833.tar.gz
gcc-d3ea4c064f6e6370eb791985fef4acdd5fb1b833.tar.bz2
re PR c++/66130 ("invalid use of non-static member function" message could be clearer)
2015-06-03 Manuel López-Ibáñez <manu@gcc.gnu.org> Paolo Carlini <paolo.carlini@oracle.com> PR c++/66130 * typeck.c (invalid_nonstatic_memfn_p): Add location_t parameter and use it in the diagnostic. (decay_conversion): Adjust call. * semantics.c (finish_decltype_type): Likewise. * call.c (resolve_args, build_new_op_1, perform_implicit_conversion_flags): Adjust calls. * cvt.c (ocp_convert, convert_to_void): Likewise. * cp-tree.h (invalid_nonstatic_memfn_p): Update declaration. 2015-06-03 Manuel López-Ibáñez <manu@gcc.gnu.org> Paolo Carlini <paolo.carlini@oracle.com> PR c++/66130 * g++.dg/other/pr66130.C: New. * g++.dg/cpp0x/pr66130.C: Likewise. Co-Authored-By: Paolo Carlini <paolo.carlini@oracle.com> From-SVN: r224099
Diffstat (limited to 'gcc/cp/call.c')
-rw-r--r--gcc/cp/call.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index bad49f1..71f7e06 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -3941,7 +3941,7 @@ resolve_args (vec<tree, va_gc> *args, tsubst_flags_t complain)
error ("invalid use of void expression");
return NULL;
}
- else if (invalid_nonstatic_memfn_p (arg, complain))
+ else if (invalid_nonstatic_memfn_p (input_location, arg, complain))
return NULL;
}
return args;
@@ -5542,9 +5542,9 @@ build_new_op_1 (location_t loc, enum tree_code code, int flags, tree arg1,
/* If one of the arguments of the operator represents
an invalid use of member function pointer, try to report
a meaningful error ... */
- if (invalid_nonstatic_memfn_p (arg1, tf_error)
- || invalid_nonstatic_memfn_p (arg2, tf_error)
- || invalid_nonstatic_memfn_p (arg3, tf_error))
+ if (invalid_nonstatic_memfn_p (loc, arg1, tf_error)
+ || invalid_nonstatic_memfn_p (loc, arg2, tf_error)
+ || invalid_nonstatic_memfn_p (loc, arg3, tf_error))
/* We displayed the error message. */;
else
{
@@ -9445,7 +9445,7 @@ perform_implicit_conversion_flags (tree type, tree expr,
Call instantiate_type to get good error messages. */
if (TREE_TYPE (expr) == unknown_type_node)
instantiate_type (type, expr, complain);
- else if (invalid_nonstatic_memfn_p (expr, complain))
+ else if (invalid_nonstatic_memfn_p (loc, expr, complain))
/* We gave an error. */;
else
error_at (loc, "could not convert %qE from %qT to %qT", expr,