]> git.ipfire.org Git - thirdparty/gcc.git/commit
diagnostics: Add function call parens matching to c_parser.
authorMark Wielaard <mark@klomp.org>
Sun, 24 May 2020 16:01:51 +0000 (18:01 +0200)
committerMark Wielaard <mark@klomp.org>
Wed, 3 Jun 2020 23:15:56 +0000 (01:15 +0200)
commit34e4962aed08b38f37e37242234bfbbd1b897f39
tree6f9f484668d6f544d2b830ee652f18c5ffe77b72
parent29e304fd5f9097335c5d7d1b16f139439eeabe1f
diagnostics: Add function call parens matching to c_parser.

The C++ parser already tracks function call parens matching, but the C
parser doesn't. This adds the same functionality to the C parser and adds
a testcase showing the C++ and C parser matching function call parens
in an error message.

gcc/c/ChangeLog:

* c-parser.c (c_parser_postfix_expression_after_primary): Add
scope with matching_parens after CPP_OPEN_PAREN.

gcc/testsuite/ChangeLog:

* c-c++-common/missing-close-func-paren.c: New test.
gcc/c/c-parser.c
gcc/testsuite/c-c++-common/missing-close-func-paren.c [new file with mode: 0644]