r274121 - in /trunk/gcc: ChangeLog c-family/Cha...

mpolacek@gcc.gnu.org mpolacek@gcc.gnu.org
Mon Aug 5 19:01:00 GMT 2019


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



More information about the Gcc-cvs mailing list