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
This commit is contained in:
parent
d2d9bc36ee
commit
5436fa2e87
|
@ -1,3 +1,9 @@
|
|||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
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
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
/* 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;
|
||||
}
|
Loading…
Reference in New Issue