PR c/56989
* c-typeck.c (default_conversion): Use better location for
error call.
* gcc.dg/pr56989.c: New test.
From-SVN: r209969
+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
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
--- /dev/null
+/* 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;
+}