aboutsummaryrefslogtreecommitdiff
path: root/gcc/c
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2015-12-16 17:34:27 +0000
committerDavid Malcolm <dmalcolm@gcc.gnu.org>2015-12-16 17:34:27 +0000
commita10704e17a43ec70076c9c54f68f67dfca209c45 (patch)
tree06e42b3a3c984a789fc1e46e75bbbbae500d417c /gcc/c
parent0f7a02a32f887d944a760004927518d903bb4443 (diff)
downloadgcc-a10704e17a43ec70076c9c54f68f67dfca209c45.zip
gcc-a10704e17a43ec70076c9c54f68f67dfca209c45.tar.gz
gcc-a10704e17a43ec70076c9c54f68f67dfca209c45.tar.bz2
C FE: fix range of primary-expression in c_parser_postfix_expression
gcc/c/ChangeLog: * c-parser.c (c_parser_postfix_expression): Use EXPR_LOC_OR_LOC to preserve range information for the primary expression in the call to c_parser_postfix_expression_after_primary. gcc/testsuite/ChangeLog: * gcc.dg/cast-function-1.c (bar): Update column numbers. * gcc.dg/diagnostic-range-bad-called-object.c: New test case. From-SVN: r231709
Diffstat (limited to 'gcc/c')
-rw-r--r--gcc/c/ChangeLog6
-rw-r--r--gcc/c/c-parser.c3
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index 3ed1326..49c3cbb 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -1,5 +1,11 @@
2015-12-16 David Malcolm <dmalcolm@redhat.com>
+ * c-parser.c (c_parser_postfix_expression): Use EXPR_LOC_OR_LOC
+ to preserve range information for the primary expression
+ in the call to c_parser_postfix_expression_after_primary.
+
+2015-12-16 David Malcolm <dmalcolm@redhat.com>
+
* c-parser.c (c_parser_static_assert_declaration_no_semi): Use the
expression location, falling back on the first token location,
rather than always using the latter.
diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c
index 5c32f45..e149e19 100644
--- a/gcc/c/c-parser.c
+++ b/gcc/c/c-parser.c
@@ -7954,7 +7954,8 @@ c_parser_postfix_expression (c_parser *parser)
expr.value = error_mark_node;
break;
}
- return c_parser_postfix_expression_after_primary (parser, loc, expr);
+ return c_parser_postfix_expression_after_primary
+ (parser, EXPR_LOC_OR_LOC (expr.value, loc), expr);
}
/* Parse a postfix expression after a parenthesized type name: the