Bug 91338 - Implement P1161R3: Deprecate a[b,c]
Summary: Implement P1161R3: Deprecate a[b,c]
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 10.0
: P3 normal
Target Milestone: ---
Assignee: Marek Polacek
URL:
Keywords: diagnostic, patch
Depends on:
Blocks:
 
Reported: 2019-08-03 17:13 UTC by Marek Polacek
Modified: 2019-08-05 19:02 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2019-08-03 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Comment 2 Marek Polacek 2019-08-05 19:01:47 UTC
Author: mpolacek
Date: Mon Aug  5 19:01:15 2019
New Revision: 274121

URL: https://gcc.gnu.org/viewcvs?rev=274121&root=gcc&view=rev
Log:
	PR c++/91338 - Implement P1161R3: Deprecate a[b,c].
	* c-opts.c (c_common_post_options): Enable -Wcomma-subscript by
	default for C++2a, unless -Wno-deprecated.
	* c.opt (Wcomma-subscript): New warning.

	* parser.c (cp_parser_postfix_open_square_expression): Warn about uses
	of a comma operator within a subscripting expression.
	(cp_parser_skip_to_closing_square_bracket_1): New function, made out
	of...
	(cp_parser_skip_to_closing_square_bracket): ...this.

	* doc/invoke.texi: Document -Wcomma-subscript.

	* g++.dg/cpp2a/comma1.C: New test.
	* g++.dg/cpp2a/comma2.C: New test.
	* g++.dg/cpp2a/comma3.C: New test.
	* g++.dg/cpp2a/comma4.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/cpp2a/comma1.C
    trunk/gcc/testsuite/g++.dg/cpp2a/comma2.C
    trunk/gcc/testsuite/g++.dg/cpp2a/comma3.C
    trunk/gcc/testsuite/g++.dg/cpp2a/comma4.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/c-family/ChangeLog
    trunk/gcc/c-family/c-opts.c
    trunk/gcc/c-family/c.opt
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/parser.c
    trunk/gcc/doc/invoke.texi
    trunk/gcc/testsuite/ChangeLog
Comment 3 Marek Polacek 2019-08-05 19:02:27 UTC
Implemented for 10.1.