+2019-06-04 Harald van Dijk <harald@gigawatt.nl>
+
+ PR c++/60531 - Wrong error about unresolved overloaded function
+ * typeck.c (cp_build_binary_op): See if overload can be resolved.
+ (cp_build_unary_op): Ditto.
+
2019-06-04 Jason Merrill <jason@redhat.com>
Reduce accumulated garbage in constexpr evaluation.
/* True if both operands have arithmetic type. */
bool arithmetic_types_p;
- /* Apply default conversions. */
- op0 = orig_op0;
- op1 = orig_op1;
-
/* Remember whether we're doing / or %. */
bool doing_div_or_mod = false;
/* Tree holding instrumentation expression. */
tree instrument_expr = NULL_TREE;
+ /* Apply default conversions. */
+ op0 = resolve_nondeduced_context (orig_op0, complain);
+ op1 = resolve_nondeduced_context (orig_op1, complain);
+
if (code == TRUTH_AND_EXPR || code == TRUTH_ANDIF_EXPR
|| code == TRUTH_OR_EXPR || code == TRUTH_ORIF_EXPR
|| code == TRUTH_XOR_EXPR)
if (!arg || error_operand_p (arg))
return error_mark_node;
+ arg = resolve_nondeduced_context (arg, complain);
+
if ((invalid_op_diag
= targetm.invalid_unary_op ((code == UNARY_PLUS_EXPR
? CONVERT_EXPR
: code),
- TREE_TYPE (xarg))))
+ TREE_TYPE (arg))))
{
if (complain & tf_error)
error (invalid_op_diag);