aboutsummaryrefslogtreecommitdiff
path: root/gcc/c
diff options
context:
space:
mode:
authorMarek Polacek <polacek@redhat.com>2014-05-01 07:08:19 +0000
committerMarek Polacek <mpolacek@gcc.gnu.org>2014-05-01 07:08:19 +0000
commit5436fa2e87fd7df010144347bd3e1fcc0a48d901 (patch)
treeb0be3faa960ae96110d9a1c9545b75f18b18b9ff /gcc/c
parentd2d9bc36ee79f7c823d1f1eb181f8eb77d8ba08b (diff)
downloadgcc-5436fa2e87fd7df010144347bd3e1fcc0a48d901.zip
gcc-5436fa2e87fd7df010144347bd3e1fcc0a48d901.tar.gz
gcc-5436fa2e87fd7df010144347bd3e1fcc0a48d901.tar.bz2
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
Diffstat (limited to 'gcc/c')
-rw-r--r--gcc/c/ChangeLog6
-rw-r--r--gcc/c/c-typeck.c3
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index bf61610..cee0329 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -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
diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c
index cb8ae44..409b0a7 100644
--- a/gcc/c/c-typeck.c
+++ b/gcc/c/c-typeck.c
@@ -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;
}