diff options
author | mpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-04-15 14:46:06 +0000 |
---|---|---|
committer | mpolacek <mpolacek@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-04-15 14:46:06 +0000 |
commit | eac243e73da4228256678258dfad7ce78bdedd8c (patch) | |
tree | 4f15149dd5627d3e757afed4ee07978cb4680f99 /gcc/c | |
parent | f650fd67e30abb3648efeb98cd9b6b42c1e9037c (diff) | |
download | gcc-eac243e73da4228256678258dfad7ce78bdedd8c.tar.gz |
PR c/70671
* c-typeck.c (build_unary_op): Pass location down to error and
warning call.
* gcc.dg/bitfld-22.c: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@235032 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c')
-rw-r--r-- | gcc/c/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/c/c-typeck.c | 13 |
2 files changed, 13 insertions, 6 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index 3ba3f4ea2d2..7257f79e0b2 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,9 @@ +2016-04-15 Marek Polacek <polacek@redhat.com> + + PR c/70671 + * c-typeck.c (build_unary_op): Pass location down to error and + warning call. + 2016-04-15 Jakub Jelinek <jakub@redhat.com> PR c/70436 diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c index 9a1499428d4..59a3c6153b7 100644 --- a/gcc/c/c-typeck.c +++ b/gcc/c/c-typeck.c @@ -4436,8 +4436,8 @@ build_unary_op (location_t location, case COMPONENT_REF: if (DECL_C_BIT_FIELD (TREE_OPERAND (arg, 1))) { - error ("cannot take address of bit-field %qD", - TREE_OPERAND (arg, 1)); + error_at (location, "cannot take address of bit-field %qD", + TREE_OPERAND (arg, 1)); return error_mark_node; } @@ -4449,15 +4449,16 @@ build_unary_op (location_t location, if (!AGGREGATE_TYPE_P (TREE_TYPE (arg)) && !VECTOR_TYPE_P (TREE_TYPE (arg))) { - error ("cannot take address of scalar with reverse storage " - "order"); + error_at (location, "cannot take address of scalar with " + "reverse storage order"); return error_mark_node; } if (TREE_CODE (TREE_TYPE (arg)) == ARRAY_TYPE && TYPE_REVERSE_STORAGE_ORDER (TREE_TYPE (arg))) - warning (OPT_Wscalar_storage_order, "address of array with " - "reverse scalar storage order requested"); + warning_at (location, OPT_Wscalar_storage_order, + "address of array with reverse scalar storage " + "order requested"); } default: |