aboutsummaryrefslogtreecommitdiff
path: root/gcc/c
diff options
context:
space:
mode:
authorMarek Polacek <polacek@redhat.com>2014-05-13 17:41:12 +0000
committerMarek Polacek <mpolacek@gcc.gnu.org>2014-05-13 17:41:12 +0000
commit2b107f6b91d1b44ec60bd5ce8b51218a84aac98a (patch)
tree71a054b65773de4a41bafae1593739847a1bbd73 /gcc/c
parent6052140cec44f7605a43a968af90797c36e47992 (diff)
downloadgcc-2b107f6b91d1b44ec60bd5ce8b51218a84aac98a.zip
gcc-2b107f6b91d1b44ec60bd5ce8b51218a84aac98a.tar.gz
gcc-2b107f6b91d1b44ec60bd5ce8b51218a84aac98a.tar.bz2
re PR c/61162 (possibly bad error location with -Wc++-compat)
PR c/61162 * c-typeck.c (convert_for_assignment): Pass location to WARN_FOR_ASSIGNMENT instead of input_location. * gcc.dg/pr61162.c: New test. From-SVN: r210393
Diffstat (limited to 'gcc/c')
-rw-r--r--gcc/c/ChangeLog6
-rw-r--r--gcc/c/c-typeck.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index 919b4ff..7b7d665 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -1,3 +1,9 @@
+2014-05-13 Marek Polacek <polacek@redhat.com>
+
+ PR c/61162
+ * c-typeck.c (convert_for_assignment): Pass location to
+ WARN_FOR_ASSIGNMENT instead of input_location.
+
2014-05-10 Marek Polacek <polacek@redhat.com>
* c-parser.c (c_parser_declaration_or_fndef): Pass init_loc to
diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c
index 4b1fe66..6f4bd4a 100644
--- a/gcc/c/c-typeck.c
+++ b/gcc/c/c-typeck.c
@@ -5754,7 +5754,7 @@ convert_for_assignment (location_t location, location_t expr_loc, tree type,
&& TREE_CODE (type) == ENUMERAL_TYPE
&& TYPE_MAIN_VARIANT (checktype) != TYPE_MAIN_VARIANT (type))
{
- WARN_FOR_ASSIGNMENT (input_location, OPT_Wc___compat,
+ WARN_FOR_ASSIGNMENT (location, OPT_Wc___compat,
G_("enum conversion when passing argument "
"%d of %qE is invalid in C++"),
G_("enum conversion in assignment is "