PR c++/91391 - bogus -Wcomma-subscript warning.
authorJakub Jelinek <jakub@redhat.com>
Wed, 14 Aug 2019 14:44:55 +0000 (16:44 +0200)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Wed, 14 Aug 2019 14:44:55 +0000 (14:44 +0000)
commitb1c0d18515f6899bc8362d9dc861021c929127f9
treea50b2b2ea91c4a1cde4a763749c70905def3adfb
parentf0033821c1c9ba386a1983499a666d5759cdd943
PR c++/91391 - bogus -Wcomma-subscript warning.

* parser.c (cp_parser_postfix_open_square_expression): Don't warn about
a deprecated comma here.  Pass warn_comma_subscript down to
cp_parser_expression.
(cp_parser_expression): New bool parameter.  Warn about uses of a comma
operator within a subscripting expression.
(cp_parser_skip_to_closing_square_bracket): Revert to pre-r274121 state.
(cp_parser_skip_to_closing_square_bracket_1): Remove.

* g++.dg/cpp2a/comma5.C: New test.

Co-Authored-By: Marek Polacek <polacek@redhat.com>
From-SVN: r274483
gcc/cp/ChangeLog
gcc/cp/parser.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp2a/comma5.C [new file with mode: 0644]