C: fix uninitialized ranges for __alignof__
authorDavid Malcolm <dmalcolm@redhat.com>
Tue, 8 Dec 2015 17:03:26 +0000 (17:03 +0000)
committerDavid Malcolm <dmalcolm@gcc.gnu.org>
Tue, 8 Dec 2015 17:03:26 +0000 (17:03 +0000)
commita1b93f8daf8029685f49cd57612d726674b8595c
treec9a3f87f1a7b95b9736b2d9e05db06d64e2291b2
parent46c6e1e20e58a8e071c163d9f1a8ea179a437fd3
C: fix uninitialized ranges for __alignof__

gcc/c/ChangeLog:
* c-parser.c (c_parser_alignof_expression): Capture location of
closing parenthesis (if any), or of end of unary expression, and
use it to build a src_range for the expression.

gcc/testsuite/ChangeLog:
* gcc.dg/plugin/diagnostic-test-expressions-1.c (test_alignof):
New test function.

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