aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2016-07-18 20:44:51 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2016-07-18 20:44:51 +0200
commit99516432c26d13ba2808daf860253b4f945336d9 (patch)
treeb7206228efa3fec183b48d41c563424e0269dcde /gcc/cp
parent87713c6a507659921278d32b66f2e344b7c4d124 (diff)
downloadgcc-99516432c26d13ba2808daf860253b4f945336d9.zip
gcc-99516432c26d13ba2808daf860253b4f945336d9.tar.gz
gcc-99516432c26d13ba2808daf860253b4f945336d9.tar.bz2
re PR c++/71835 (ICE on invalid C++ code with ambiguous overloaded operators: tree check: expected tree that contains ‘decl minimal’ structure, have ‘pointer_type’ in convert_like_real, at cp/call.c:6549)
PR c++/71835 * call.c (build_op_call_1): Use convert_like_with_context only if cand->fn is a decl. * g++.dg/conversion/ambig3.C: New test. From-SVN: r238443
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/call.c7
2 files changed, 9 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 87d666e..9fa2f3a 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,9 @@
2016-07-18 Jakub Jelinek <jakub@redhat.com>
+ PR c++/71835
+ * call.c (build_op_call_1): Use convert_like_with_context only
+ if cand->fn is a decl.
+
PR c++/71828
* constexpr.c (cxx_eval_constant_expression) <case REALPART_EXPR>:
For lval don't use cxx_eval_unary_expression and instead recurse
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 889852f..f929fb2 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -4412,8 +4412,11 @@ build_op_call_1 (tree obj, vec<tree, va_gc> **args, tsubst_flags_t complain)
result = build_over_call (cand, LOOKUP_NORMAL, complain);
else
{
- obj = convert_like_with_context (cand->convs[0], obj, cand->fn, -1,
- complain);
+ if (DECL_P (cand->fn))
+ obj = convert_like_with_context (cand->convs[0], obj, cand->fn,
+ -1, complain);
+ else
+ obj = convert_like (cand->convs[0], obj, complain);
obj = convert_from_reference (obj);
result = cp_build_function_call_vec (obj, args, complain);
}