PR c/68757: fix uninitialized src_range for various builtins
authorDavid Malcolm <dmalcolm@redhat.com>
Tue, 8 Dec 2015 16:57:27 +0000 (16:57 +0000)
committerDavid Malcolm <dmalcolm@gcc.gnu.org>
Tue, 8 Dec 2015 16:57:27 +0000 (16:57 +0000)
commit46c6e1e20e58a8e071c163d9f1a8ea179a437fd3
treec3af79a3c9a843c1afc6cac97b3ba8ab635198e0
parentb26a3da5cc6a2c5a09aef9c274190bff5fd9fa26
PR c/68757: fix uninitialized src_range for various builtins

gcc/c/ChangeLog:
PR c/68757
* c-parser.c (c_parser_get_builtin_args): Add
"out_close_paren_loc" param, and write back to it.
(c_parser_postfix_expression): Capture the closing
parenthesis location for RID_CHOOSE_EXPR,
RID_BUILTIN_CALL_WITH_STATIC_CHAIN, RID_BUILTIN_COMPLEX,
RID_BUILTIN_SHUFFLE and use it to set the source range
for such expressions; within RID_BUILTIN_COMPLEX set
the underlying location.

gcc/testsuite/ChangeLog:
PR c/68757
* gcc.dg/plugin/diagnostic-test-expressions-1.c
(test_builtin_choose_expr): New test function.
(test_builtin_call_with_static_chain): Likewise.
(test_builtin_complex): Likewise.
(test_builtin_shuffle): Likewise.

From-SVN: r231414
gcc/c/ChangeLog
gcc/c/c-parser.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/plugin/diagnostic-test-expressions-1.c