candidate->convs[0]->type);
}
else if (TYPE_P (candidate->fn))
- inform (input_location, "%s%T <conversion>", msg, candidate->fn);
+ inform (loc, "%s%T <conversion>", msg, candidate->fn);
else if (candidate->viable == -1)
inform (loc, "%s%#D <near match>", msg, candidate->fn);
else if (DECL_DELETED_FN (STRIP_TEMPLATE (candidate->fn)))
conversion *conv;
void *p;
tree t;
+ location_t loc = EXPR_LOC_OR_HERE (expr);
if (error_operand_p (expr))
return error_mark_node;
break;
if (complain & tf_error)
- error ("conversion from %qT to %qT not considered for "
- "non-type template argument", t, type);
+ error_at (loc, "conversion from %qT to %qT not considered for "
+ "non-type template argument", t, type);
/* and fall through. */
default:
tree totype = convs->type;
diagnostic_t diag_kind;
int flags;
+ location_t loc = EXPR_LOC_OR_HERE (expr);
if (convs->bad_p && !(complain & tf_error))
return error_mark_node;
&& SCALAR_TYPE_P (totype)
&& CONSTRUCTOR_NELTS (expr) > 0
&& BRACE_ENCLOSED_INITIALIZER_P (CONSTRUCTOR_ELT (expr, 0)->value))
- permerror (input_location, "too many braces around initializer for %qT", totype);
+ permerror (loc, "too many braces around initializer for %qT", totype);
for (; t ; t = next_conversion (t))
{
if (t->kind == ck_user && t->cand->reason)
{
- permerror (input_location, "invalid user-defined conversion "
+ permerror (loc, "invalid user-defined conversion "
"from %qT to %qT", TREE_TYPE (expr), totype);
print_z_candidate ("candidate is:", t->cand);
expr = convert_like_real (t, expr, fn, argnum, 1,
break;
}
- permerror (input_location, "invalid conversion from %qT to %qT",
+ permerror (loc, "invalid conversion from %qT to %qT",
TREE_TYPE (expr), totype);
if (fn)
permerror (DECL_SOURCE_LOCATION (fn),
gcc_assert (TYPE_REF_IS_RVALUE (ref_type)
&& real_lvalue_p (expr));
- error ("cannot bind %qT lvalue to %qT",
- TREE_TYPE (expr), totype);
+ error_at (loc, "cannot bind %qT lvalue to %qT",
+ TREE_TYPE (expr), totype);
if (fn)
error (" initializing argument %P of %q+D", argnum, fn);
return error_mark_node;
/* If the reference is volatile or non-const, we
cannot create a temporary. */
if (lvalue & clk_bitfield)
- error ("cannot bind bitfield %qE to %qT",
- expr, ref_type);
+ error_at (loc, "cannot bind bitfield %qE to %qT",
+ expr, ref_type);
else if (lvalue & clk_packed)
- error ("cannot bind packed field %qE to %qT",
- expr, ref_type);
+ error_at (loc, "cannot bind packed field %qE to %qT",
+ expr, ref_type);
else
- error ("cannot bind rvalue %qE to %qT", expr, ref_type);
+ error_at (loc, "cannot bind rvalue %qE to %qT",
+ expr, ref_type);
return error_mark_node;
}
/* If the source is a packed field, and we must use a copy
&& CLASS_TYPE_P (type)
&& type_has_nontrivial_copy_init (type))
{
- error ("cannot bind packed field %qE to %qT",
- expr, ref_type);
+ error_at (loc, "cannot bind packed field %qE to %qT",
+ expr, ref_type);
return error_mark_node;
}
if (lvalue & clk_bitfield)
convert_arg_to_ellipsis (tree arg, tsubst_flags_t complain)
{
tree arg_type;
+ location_t loc = EXPR_LOC_OR_HERE (arg);
/* [expr.call]
{
if ((complain & tf_warning)
&& warn_double_promotion && !c_inhibit_evaluation_warnings)
- warning (OPT_Wdouble_promotion,
- "implicit conversion from %qT to %qT when passing "
- "argument to function",
- arg_type, double_type_node);
+ warning_at (loc, OPT_Wdouble_promotion,
+ "implicit conversion from %qT to %qT when passing "
+ "argument to function",
+ arg_type, double_type_node);
arg = convert_to_real (double_type_node, arg);
}
else if (NULLPTR_TYPE_P (arg_type))
if (SCOPED_ENUM_P (arg_type) && !abi_version_at_least (6))
{
if (complain & tf_warning)
- warning (OPT_Wabi, "scoped enum %qT will not promote to an "
- "integral type in a future version of GCC", arg_type);
+ warning_at (loc, OPT_Wabi, "scoped enum %qT will not promote to an "
+ "integral type in a future version of GCC", arg_type);
arg = cp_convert (ENUM_UNDERLYING_TYPE (arg_type), arg);
}
arg = perform_integral_promotions (arg);
|| TYPE_HAS_NONTRIVIAL_DESTRUCTOR (arg_type)))
{
if (complain & tf_error)
- error ("cannot pass objects of non-trivially-copyable "
- "type %q#T through %<...%>", arg_type);
+ error_at (loc, "cannot pass objects of non-trivially-copyable "
+ "type %q#T through %<...%>", arg_type);
else
return error_mark_node;
}
{
conversion *conv;
void *p;
+ location_t loc = EXPR_LOC_OR_HERE (expr);
if (error_operand_p (expr))
return error_mark_node;
else if (invalid_nonstatic_memfn_p (expr, complain))
/* We gave an error. */;
else
- error ("could not convert %qE from %qT to %qT", expr,
- TREE_TYPE (expr), type);
+ error_at (loc, "could not convert %qE from %qT to %qT", expr,
+ TREE_TYPE (expr), type);
}
expr = error_mark_node;
}
{
conversion *conv;
void *p;
+ location_t loc = EXPR_LOC_OR_HERE (expr);
if (type == error_mark_node || error_operand_p (expr))
return error_mark_node;
else if (!CP_TYPE_CONST_P (TREE_TYPE (type))
&& !TYPE_REF_IS_RVALUE (type)
&& !real_lvalue_p (expr))
- error ("invalid initialization of non-const reference of "
- "type %qT from an rvalue of type %qT",
- type, TREE_TYPE (expr));
+ error_at (loc, "invalid initialization of non-const reference of "
+ "type %qT from an rvalue of type %qT",
+ type, TREE_TYPE (expr));
else
- error ("invalid initialization of reference of type "
- "%qT from expression of type %qT", type,
- TREE_TYPE (expr));
+ error_at (loc, "invalid initialization of reference of type "
+ "%qT from expression of type %qT", type,
+ TREE_TYPE (expr));
}
return error_mark_node;
}
static tree convert_to_pointer_force (tree, tree);
static tree build_type_conversion (tree, tree);
static tree build_up_reference (tree, tree, int, tree);
-static void warn_ref_binding (tree, tree, tree);
+static void warn_ref_binding (location_t, tree, tree, tree);
/* Change of width--truncation and extension of integers or reals--
is represented with NOP_EXPR. Proper functioning of many things
tree intype = TREE_TYPE (expr);
enum tree_code form;
tree rval;
+ location_t loc = EXPR_LOC_OR_HERE (expr);
+
if (intype == error_mark_node)
return error_mark_node;
intype = complete_type (intype);
if (!COMPLETE_TYPE_P (intype))
{
- error ("can%'t convert from incomplete type %qT to %qT",
- intype, type);
+ error_at (loc, "can%'t convert from incomplete type %qT to %qT",
+ intype, type);
return error_mark_node;
}
if (rval)
{
if (rval == error_mark_node)
- error ("conversion of %qE from %qT to %qT is ambiguous",
- expr, intype, type);
+ error_at (loc, "conversion of %qE from %qT to %qT is ambiguous",
+ expr, intype, type);
return rval;
}
}
if (TYPE_PTRMEMFUNC_P (type))
{
- error ("cannot convert %qE from type %qT to type %qT",
- expr, intype, type);
+ error_at (loc, "cannot convert %qE from type %qT to type %qT",
+ expr, intype, type);
return error_mark_node;
}
tf_warning_or_error);
}
}
- error ("cannot convert %qE from type %qT to type %qT",
- expr, intype, type);
+ error_at (loc, "cannot convert %qE from type %qT to type %qT",
+ expr, intype, type);
return error_mark_node;
}
{
if (c_inhibit_evaluation_warnings == 0
&& !NULLPTR_TYPE_P (TREE_TYPE (expr)))
- warning (OPT_Wzero_as_null_pointer_constant,
- "zero as null pointer constant");
+ warning_at (loc, OPT_Wzero_as_null_pointer_constant,
+ "zero as null pointer constant");
if (TYPE_PTRMEMFUNC_P (type))
return build_ptrmemfunc (TYPE_PTRMEMFUNC_FN_TYPE (type), expr, 0,
}
else if (TYPE_PTR_TO_MEMBER_P (type) && INTEGRAL_CODE_P (form))
{
- error ("invalid conversion from %qT to %qT", intype, type);
+ error_at (loc, "invalid conversion from %qT to %qT", intype, type);
return error_mark_node;
}
if (type_unknown_p (expr))
return instantiate_type (type, expr, tf_warning_or_error);
- error ("cannot convert %qE from type %qT to type %qT",
- expr, intype, type);
+ error_at (loc, "cannot convert %qE from type %qT to type %qT",
+ expr, intype, type);
return error_mark_node;
}
non-volatile const type. */
static void
-warn_ref_binding (tree reftype, tree intype, tree decl)
+warn_ref_binding (location_t loc, tree reftype, tree intype, tree decl)
{
tree ttl = TREE_TYPE (reftype);
msg = G_("conversion to non-const reference type %q#T from "
"rvalue of type %qT");
- permerror (input_location, msg, reftype, intype);
+ permerror (loc, msg, reftype, intype);
}
}
bool can_convert_intype_to_type;
tsubst_flags_t complain = ((flags & LOOKUP_COMPLAIN)
? tf_warning_or_error : tf_none);
+ location_t loc = EXPR_LOC_OR_HERE (expr);
if (TREE_CODE (type) == FUNCTION_TYPE
&& TREE_TYPE (expr) == unknown_type_node)
tree ttr = lvalue_type (expr);
if (! real_lvalue_p (expr))
- warn_ref_binding (reftype, intype, decl);
+ warn_ref_binding (loc, reftype, intype, decl);
if (! (convtype & CONV_CONST)
&& !at_least_as_qualified_p (ttl, ttr))
- permerror (input_location, "conversion from %qT to %qT discards qualifiers",
+ permerror (loc, "conversion from %qT to %qT discards qualifiers",
ttr, reftype);
}
if (TREE_CODE (intype) == POINTER_TYPE
&& (comptypes (TREE_TYPE (intype), type,
COMPARE_BASE | COMPARE_DERIVED)))
- warning (0, "casting %qT to %qT does not dereference pointer",
- intype, reftype);
+ warning_at (loc, 0, "casting %qT to %qT does not dereference pointer",
+ intype, reftype);
rval = cp_build_addr_expr (expr, tf_warning_or_error);
if (rval != error_mark_node)
tf_warning_or_error);
if (rval == NULL_TREE || rval == error_mark_node)
return rval;
- warn_ref_binding (reftype, intype, decl);
+ warn_ref_binding (loc, reftype, intype, decl);
rval = build_up_reference (reftype, rval, flags, decl);
}
}
if (flags & LOOKUP_COMPLAIN)
- error ("cannot convert type %qT to type %qT", intype, reftype);
+ error_at (loc, "cannot convert type %qT to type %qT", intype, reftype);
return error_mark_node;
}
enum tree_code code = TREE_CODE (type);
const char *invalid_conv_diag;
tree e1;
+ location_t loc = EXPR_LOC_OR_HERE (expr);
if (error_operand_p (e) || type == error_mark_node)
return error_mark_node;
|| TREE_CODE (intype) == POINTER_TYPE)
{
if (flags & LOOKUP_COMPLAIN)
- permerror (input_location, "conversion from %q#T to %q#T", intype, type);
-
+ permerror (loc, "conversion from %q#T to %q#T", intype, type);
if (!flag_permissive)
return error_mark_node;
}
unspecified. */
if (TREE_CODE (expr) == INTEGER_CST
&& !int_fits_type_p (expr, ENUM_UNDERLYING_TYPE (type)))
- warning (OPT_Wconversion,
- "the result of the conversion is unspecified because "
- "%qE is outside the range of type %qT",
- expr, type);
+ warning_at (loc, OPT_Wconversion,
+ "the result of the conversion is unspecified because "
+ "%qE is outside the range of type %qT",
+ expr, type);
}
if (MAYBE_CLASS_TYPE_P (intype))
{
if (rval)
return rval;
if (flags & LOOKUP_COMPLAIN)
- error ("%q#T used where a %qT was expected", intype, type);
+ error_at (loc, "%q#T used where a %qT was expected", intype, type);
return error_mark_node;
}
if (code == BOOLEAN_TYPE)
{
+ if (TREE_CODE (intype) == VOID_TYPE)
+ {
+ error_at (loc, "could not convert %qE from %<void%> to %<bool%>",
+ expr);
+ return error_mark_node;
+ }
+
/* We can't implicitly convert a scoped enum to bool, so convert
to the underlying type first. */
if (SCOPED_ENUM_P (intype) && (convtype & CONV_STATIC))
if (ret_val)
return ret_val;
if (flags & LOOKUP_COMPLAIN)
- error ("%q#T used where a %qT was expected", in_vtype, type);
+ error_at (loc, "%q#T used where a %qT was expected", in_vtype, type);
return error_mark_node;
}
return fold_if_not_in_template (convert_to_vector (type, e));
return rval;
else
if (flags & LOOKUP_COMPLAIN)
- error ("%q#T used where a floating point value was expected",
+ error_at (loc, "%q#T used where a floating point value was expected",
TREE_TYPE (e));
}
if (code == REAL_TYPE)
if (invalid_nonstatic_memfn_p (expr, tf_warning_or_error))
/* We displayed the error message. */;
else
- error ("conversion from %qT to non-scalar type %qT requested",
- TREE_TYPE (expr), type);
+ error_at (loc, "conversion from %qT to non-scalar type %qT requested",
+ TREE_TYPE (expr), type);
}
return error_mark_node;
}
tree
convert_to_void (tree expr, impl_conv_void implicit, tsubst_flags_t complain)
{
+ location_t loc = EXPR_LOC_OR_HERE (expr);
+
if (expr == error_mark_node
|| TREE_TYPE (expr) == error_mark_node)
return error_mark_node;
if (TREE_CODE (expr) == PSEUDO_DTOR_EXPR)
{
if (complain & tf_error)
- error ("pseudo-destructor is not called");
+ error_at (loc, "pseudo-destructor is not called");
return error_mark_node;
}
if (VOID_TYPE_P (TREE_TYPE (expr)))
switch (implicit)
{
case ICV_CAST:
- warning (0, "conversion to void will not access "
+ warning_at (loc, 0, "conversion to void will not access "
"object of incomplete type %qT", type);
break;
case ICV_SECOND_OF_COND:
- warning (0, "indirection will not access object of "
+ warning_at (loc, 0, "indirection will not access object of "
"incomplete type %qT in second operand "
"of conditional expression", type);
break;
case ICV_THIRD_OF_COND:
- warning (0, "indirection will not access object of "
+ warning_at (loc, 0, "indirection will not access object of "
"incomplete type %qT in third operand "
"of conditional expression", type);
break;
case ICV_RIGHT_OF_COMMA:
- warning (0, "indirection will not access object of "
+ warning_at (loc, 0, "indirection will not access object of "
"incomplete type %qT in right operand of "
"comma operator", type);
break;
case ICV_LEFT_OF_COMMA:
- warning (0, "indirection will not access object of "
+ warning_at (loc, 0, "indirection will not access object of "
"incomplete type %qT in left operand of "
"comma operator", type);
break;
case ICV_STATEMENT:
- warning (0, "indirection will not access object of "
+ warning_at (loc, 0, "indirection will not access object of "
"incomplete type %qT in statement", type);
break;
case ICV_THIRD_IN_FOR:
- warning (0, "indirection will not access object of "
+ warning_at (loc, 0, "indirection will not access object of "
"incomplete type %qT in for increment "
"expression", type);
break;
switch (implicit)
{
case ICV_CAST:
- warning (0, "conversion to void will not access "
+ warning_at (loc, 0, "conversion to void will not access "
"object of type %qT", type);
break;
case ICV_SECOND_OF_COND:
- warning (0, "implicit dereference will not access object "
- "of type %qT in second operand of "
+ warning_at (loc, 0, "implicit dereference will not access "
+ "object of type %qT in second operand of "
"conditional expression", type);
break;
case ICV_THIRD_OF_COND:
- warning (0, "implicit dereference will not access object "
- "of type %qT in third operand of "
+ warning_at (loc, 0, "implicit dereference will not access "
+ "object of type %qT in third operand of "
"conditional expression", type);
break;
case ICV_RIGHT_OF_COMMA:
- warning (0, "implicit dereference will not access object "
- "of type %qT in right operand of "
+ warning_at (loc, 0, "implicit dereference will not access "
+ "object of type %qT in right operand of "
"comma operator", type);
break;
case ICV_LEFT_OF_COMMA:
- warning (0, "implicit dereference will not access object "
- "of type %qT in left operand of comma operator",
- type);
+ warning_at (loc, 0, "implicit dereference will not access "
+ "object of type %qT in left operand of comma "
+ "operator", type);
break;
case ICV_STATEMENT:
- warning (0, "implicit dereference will not access object "
- "of type %qT in statement", type);
+ warning_at (loc, 0, "implicit dereference will not access "
+ "object of type %qT in statement", type);
break;
case ICV_THIRD_IN_FOR:
- warning (0, "implicit dereference will not access object "
- "of type %qT in for increment expression",
- type);
+ warning_at (loc, 0, "implicit dereference will not access "
+ "object of type %qT in for increment expression",
+ type);
break;
default:
gcc_unreachable ();
switch (implicit)
{
case ICV_CAST:
- warning (0, "conversion to void will not access "
+ warning_at (loc, 0, "conversion to void will not access "
"object of non-trivially-copyable type %qT",
- type);
+ type);
break;
case ICV_SECOND_OF_COND:
- warning (0, "indirection will not access object of "
+ warning_at (loc, 0, "indirection will not access object of "
"non-trivially-copyable type %qT in second "
"operand of conditional expression", type);
break;
case ICV_THIRD_OF_COND:
- warning (0, "indirection will not access object of "
+ warning_at (loc, 0, "indirection will not access object of "
"non-trivially-copyable type %qT in third "
"operand of conditional expression", type);
break;
case ICV_RIGHT_OF_COMMA:
- warning (0, "indirection will not access object of "
+ warning_at (loc, 0, "indirection will not access object of "
"non-trivially-copyable type %qT in right "
"operand of comma operator", type);
break;
case ICV_LEFT_OF_COMMA:
- warning (0, "indirection will not access object of "
+ warning_at (loc, 0, "indirection will not access object of "
"non-trivially-copyable type %qT in left "
"operand of comma operator", type);
break;
case ICV_STATEMENT:
- warning (0, "indirection will not access object of "
+ warning_at (loc, 0, "indirection will not access object of "
"non-trivially-copyable type %qT in statement",
- type);
+ type);
break;
case ICV_THIRD_IN_FOR:
- warning (0, "indirection will not access object of "
+ warning_at (loc, 0, "indirection will not access object of "
"non-trivially-copyable type %qT in for "
"increment expression", type);
break;
&& (complain & tf_warning)
&& !TREE_NO_WARNING (expr)
&& !is_reference)
- warning (OPT_Wunused_value, "value computed is not used");
+ warning_at (loc, OPT_Wunused_value, "value computed is not used");
expr = TREE_OPERAND (expr, 0);
}
switch (implicit)
{
case ICV_CAST:
- warning (0, "conversion to void will not access "
+ warning_at (loc, 0, "conversion to void will not access "
"object %qE of incomplete type %qT", expr, type);
break;
case ICV_SECOND_OF_COND:
- warning (0, "variable %qE of incomplete type %qT will not "
- "be accessed in second operand of "
+ warning_at (loc, 0, "variable %qE of incomplete type %qT will "
+ "not be accessed in second operand of "
"conditional expression", expr, type);
break;
case ICV_THIRD_OF_COND:
- warning (0, "variable %qE of incomplete type %qT will not "
- "be accessed in third operand of "
+ warning_at (loc, 0, "variable %qE of incomplete type %qT will "
+ "not be accessed in third operand of "
"conditional expression", expr, type);
break;
case ICV_RIGHT_OF_COMMA:
- warning (0, "variable %qE of incomplete type %qT will not "
- "be accessed in right operand of comma operator",
- expr, type);
+ warning_at (loc, 0, "variable %qE of incomplete type %qT will "
+ "not be accessed in right operand of comma operator",
+ expr, type);
break;
case ICV_LEFT_OF_COMMA:
- warning (0, "variable %qE of incomplete type %qT will not "
- "be accessed in left operand of comma operator",
- expr, type);
+ warning_at (loc, 0, "variable %qE of incomplete type %qT will "
+ "not be accessed in left operand of comma operator",
+ expr, type);
break;
case ICV_STATEMENT:
- warning (0, "variable %qE of incomplete type %qT will not "
- "be accessed in statement", expr, type);
+ warning_at (loc, 0, "variable %qE of incomplete type %qT will "
+ "not be accessed in statement", expr, type);
break;
case ICV_THIRD_IN_FOR:
- warning (0, "variable %qE of incomplete type %qT will not "
- "be accessed in for increment expression",
- expr, type);
+ warning_at (loc, 0, "variable %qE of incomplete type %qT will "
+ "not be accessed in for increment expression",
+ expr, type);
break;
default:
gcc_unreachable ();
switch (implicit)
{
case ICV_CAST:
- error ("conversion to void "
- "cannot resolve address of overloaded function");
+ error_at (loc, "conversion to void "
+ "cannot resolve address of overloaded function");
break;
case ICV_SECOND_OF_COND:
- error ("second operand of conditional expression "
- "cannot resolve address of overloaded function");
+ error_at (loc, "second operand of conditional expression "
+ "cannot resolve address of overloaded function");
break;
case ICV_THIRD_OF_COND:
- error ("third operand of conditional expression "
- "cannot resolve address of overloaded function");
+ error_at (loc, "third operand of conditional expression "
+ "cannot resolve address of overloaded function");
break;
case ICV_RIGHT_OF_COMMA:
- error ("right operand of comma operator "
- "cannot resolve address of overloaded function");
+ error_at (loc, "right operand of comma operator "
+ "cannot resolve address of overloaded function");
break;
case ICV_LEFT_OF_COMMA:
- error ("left operand of comma operator "
- "cannot resolve address of overloaded function");
+ error_at (loc, "left operand of comma operator "
+ "cannot resolve address of overloaded function");
break;
case ICV_STATEMENT:
- error ("statement "
- "cannot resolve address of overloaded function");
+ error_at (loc, "statement "
+ "cannot resolve address of overloaded function");
break;
case ICV_THIRD_IN_FOR:
- error ("for increment expression "
- "cannot resolve address of overloaded function");
+ error_at (loc, "for increment expression "
+ "cannot resolve address of overloaded function");
break;
}
else
switch (implicit)
{
case ICV_SECOND_OF_COND:
- warning (OPT_Waddress,
- "second operand of conditional expression "
- "is a reference, not call, to function %qE", expr);
+ warning_at (loc, OPT_Waddress,
+ "second operand of conditional expression "
+ "is a reference, not call, to function %qE", expr);
break;
case ICV_THIRD_OF_COND:
- warning (OPT_Waddress,
- "third operand of conditional expression "
- "is a reference, not call, to function %qE", expr);
+ warning_at (loc, OPT_Waddress,
+ "third operand of conditional expression "
+ "is a reference, not call, to function %qE", expr);
break;
case ICV_RIGHT_OF_COMMA:
- warning (OPT_Waddress,
- "right operand of comma operator "
- "is a reference, not call, to function %qE", expr);
+ warning_at (loc, OPT_Waddress,
+ "right operand of comma operator "
+ "is a reference, not call, to function %qE", expr);
break;
case ICV_LEFT_OF_COMMA:
- warning (OPT_Waddress,
- "left operand of comma operator "
- "is a reference, not call, to function %qE", expr);
+ warning_at (loc, OPT_Waddress,
+ "left operand of comma operator "
+ "is a reference, not call, to function %qE", expr);
break;
case ICV_STATEMENT:
- warning (OPT_Waddress,
- "statement is a reference, not call, to function %qE",
- expr);
+ warning_at (loc, OPT_Waddress,
+ "statement is a reference, not call, to function %qE",
+ expr);
break;
case ICV_THIRD_IN_FOR:
- warning (OPT_Waddress,
- "for increment expression "
- "is a reference, not call, to function %qE", expr);
+ warning_at (loc, OPT_Waddress,
+ "for increment expression "
+ "is a reference, not call, to function %qE", expr);
break;
default:
gcc_unreachable ();
switch (implicit)
{
case ICV_SECOND_OF_COND:
- warning (OPT_Wunused_value,
- "second operand of conditional expression has no effect");
+ warning_at (loc, OPT_Wunused_value,
+ "second operand of conditional expression "
+ "has no effect");
break;
case ICV_THIRD_OF_COND:
- warning (OPT_Wunused_value,
- "third operand of conditional expression has no effect");
+ warning_at (loc, OPT_Wunused_value,
+ "third operand of conditional expression "
+ "has no effect");
break;
case ICV_RIGHT_OF_COMMA:
- warning (OPT_Wunused_value,
- "right operand of comma operator has no effect");
+ warning_at (loc, OPT_Wunused_value,
+ "right operand of comma operator has no effect");
break;
case ICV_LEFT_OF_COMMA:
- warning (OPT_Wunused_value,
- "left operand of comma operator has no effect");
+ warning_at (loc, OPT_Wunused_value,
+ "left operand of comma operator has no effect");
break;
case ICV_STATEMENT:
- warning (OPT_Wunused_value,
- "statement has no effect");
+ warning_at (loc, OPT_Wunused_value,
+ "statement has no effect");
break;
case ICV_THIRD_IN_FOR:
- warning (OPT_Wunused_value,
- "for increment expression has no effect");
+ warning_at (loc, OPT_Wunused_value,
+ "for increment expression has no effect");
break;
default:
gcc_unreachable ();
|| code == POSTDECREMENT_EXPR
|| code == POSTINCREMENT_EXPR)))
&& (complain & tf_warning))
- warning (OPT_Wunused_value, "value computed is not used");
+ warning_at (loc, OPT_Wunused_value, "value computed is not used");
}
}
expr = build1 (CONVERT_EXPR, void_type_node, expr);