aboutsummaryrefslogtreecommitdiff
path: root/gcc/c
diff options
context:
space:
mode:
authorDavid Malcolm <dmalcolm@redhat.com>2016-03-18 17:45:42 +0000
committerDavid Malcolm <dmalcolm@gcc.gnu.org>2016-03-18 17:45:42 +0000
commit4bbf545b8b47ef2a1a2a8a666f88dfe7ba9fe23a (patch)
tree644fd8f0c6ad439a0d06fcb755af022355f98968 /gcc/c
parentf2f48c6c60549b62dbe8260b9b6d7227a25dddf8 (diff)
downloadgcc-4bbf545b8b47ef2a1a2a8a666f88dfe7ba9fe23a.zip
gcc-4bbf545b8b47ef2a1a2a8a666f88dfe7ba9fe23a.tar.gz
gcc-4bbf545b8b47ef2a1a2a8a666f88dfe7ba9fe23a.tar.bz2
PR c/70281: C FE: fix uninitialized range for __builtin_types_compatible_p
gcc/c/ChangeLog: PR c/70281 * c-parser.c (c_parser_postfix_expression): Set the source range for uses of "__builtin_types_compatible_p". gcc/testsuite/ChangeLog: PR c/70281 * gcc.dg/plugin/diagnostic-test-expressions-1.c (test_builtin_types_compatible_p): New test function. * gcc.dg/pr70281.c: New test case. From-SVN: r234340
Diffstat (limited to 'gcc/c')
-rw-r--r--gcc/c/ChangeLog6
-rw-r--r--gcc/c/c-parser.c6
2 files changed, 10 insertions, 2 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index 3d57c76c..c8cb022 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -1,3 +1,9 @@
+2016-03-18 David Malcolm <dmalcolm@redhat.com>
+
+ PR c/70281
+ * c-parser.c (c_parser_postfix_expression): Set the source range
+ for uses of "__builtin_types_compatible_p".
+
2016-03-17 Jakub Jelinek <jakub@redhat.com>
PR c/70280
diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c
index 82d6eca..6460684 100644
--- a/gcc/c/c-parser.c
+++ b/gcc/c/c-parser.c
@@ -7782,9 +7782,10 @@ c_parser_postfix_expression (c_parser *parser)
expr.value = error_mark_node;
break;
}
- c_parser_skip_until_found (parser, CPP_CLOSE_PAREN,
- "expected %<)%>");
{
+ location_t close_paren_loc = c_parser_peek_token (parser)->location;
+ c_parser_skip_until_found (parser, CPP_CLOSE_PAREN,
+ "expected %<)%>");
tree e1, e2;
e1 = groktypename (t1, NULL, NULL);
e2 = groktypename (t2, NULL, NULL);
@@ -7799,6 +7800,7 @@ c_parser_postfix_expression (c_parser *parser)
expr.value
= comptypes (e1, e2) ? integer_one_node : integer_zero_node;
+ set_c_expr_source_range (&expr, loc, close_paren_loc);
}
break;
case RID_BUILTIN_CALL_WITH_STATIC_CHAIN: