Commit 5436fa2e by Marek Polacek Committed by Marek Polacek

re PR c/56989 (wrong location in error message)

	PR c/56989
	* c-typeck.c (default_conversion): Use better location for
	error call.

	* gcc.dg/pr56989.c: New test.

From-SVN: r209969
parent d2d9bc36
2014-05-01 Marek Polacek <polacek@redhat.com>
PR c/56989
* c-typeck.c (default_conversion): Use better location for
error call.
2014-04-30 Marek Polacek <polacek@redhat.com>
* c-typeck.c (build_binary_op): Call ubsan_instrument_division
......
......@@ -2107,7 +2107,8 @@ default_conversion (tree exp)
if (code == VOID_TYPE)
{
error ("void value not ignored as it ought to be");
error_at (EXPR_LOC_OR_LOC (exp, input_location),
"void value not ignored as it ought to be");
return error_mark_node;
}
......
2014-05-01 Marek Polacek <polacek@redhat.com>
PR c/56989
* gcc.dg/pr56989.c: New test.
2014-04-30 Ian Lance Taylor <iant@google.com>
* go.test/go-test.exp (go-gc-tests): For rundir, pass extra files
......
/* PR c/56989 */
/* { dg-do compile } */
extern void voidf (void);
extern int intf (void);
int
f (void)
{
if (intf () < 0
|| voidf () < 0) /* { dg-error "10:void value not ignored as it ought to be" } */
return 1;
if (voidf () < 0 /* { dg-error "7:void value not ignored as it ought to be" } */
|| intf () < 0)
return 1;
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment