From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 5AB633857C72 for ; Thu, 28 Oct 2021 14:38:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5AB633857C72 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-584-JuHsR1hcOx2FatH76c6W7w-1; Thu, 28 Oct 2021 10:38:13 -0400 X-MC-Unique: JuHsR1hcOx2FatH76c6W7w-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1DC0610A8E00 for ; Thu, 28 Oct 2021 14:38:13 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.193.172]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AD16969217; Thu, 28 Oct 2021 14:38:07 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.16.1/8.16.1) with ESMTPS id 19SEc5HO2075700 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 28 Oct 2021 16:38:05 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.16.1/8.16.1/Submit) id 19SEc46x2075699; Thu, 28 Oct 2021 16:38:04 +0200 Date: Thu, 28 Oct 2021 16:38:04 +0200 From: Jakub Jelinek To: Jason Merrill Cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] c++: Implement C++23 P2128R6 - Multidimensional subscript operator [PR102611] Message-ID: <20211028143804.GT304296@tucnak> Reply-To: Jakub Jelinek References: <20211014082629.GR304296@tucnak> MIME-Version: 1.0 In-Reply-To: <20211014082629.GR304296@tucnak> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Oct 2021 14:38:17 -0000 Hi! On Thu, Oct 14, 2021 at 10:26:29AM +0200, Jakub Jelinek via Gcc-patches wrote: > The following patch implements the C++23 Multidimensional subscript operator > P2128R6 paper. I'd like to ping this patch. Thanks. > 2021-10-14 Jakub Jelinek > > PR c++/102611 > gcc/ > * doc/invoke.texi (-Wcomma-subscript): Document that for > -std=c++20 the option isn't enabled by default with -Wno-deprecated > but for -std=c++23 it is. > gcc/c-family/ > * c-opts.c (c_common_post_options): Enable -Wcomma-subscript by > default for C++23 regardless of warn_deprecated. > * c-cppbuiltin.c (c_cpp_builtins): Predefine > __cpp_multidimensional_subscript=202110L for C++23. > gcc/cp/ > * cp-tree.h (build_op_subscript): Implement P2128R6 > - Multidimensional subscript operator. Declare. > (grok_array_decl): Remove bool argument, add vec ** > and tsubst_flags_t arguments. > (build_min_non_dep_op_overload): Declare another overload. > * parser.c (cp_parser_postfix_expression): Mention C++23 syntax > in function comment. For C++23 parse zero or more than one > initializer clauses in expression list, adjust grok_array_decl > caller. > (cp_parser_builtin_offsetof): Adjust grok_array_decl caller. > * decl.c (grok_op_properties): For C++23 don't check number > of arguments of operator[]. > * decl2.c (grok_array_decl): Remove decltype_p argument, add > index_exp_list and complain arguments. If index_exp is NULL, > handle *index_exp_list as the subscript expression list. > * tree.c (build_min_non_dep_op_overload): New overload. > * call.c (build_op_subscript_1, build_op_subscript): New > functions. > * pt.c (tsubst_copy_and_build) : If second > operand is magic CALL_EXPR with ovl_op_identifier (ARRAY_REF) > as CALL_EXPR_FN, tsubst CALL_EXPR arguments including expanding > pack expressions in it and call grok_array_decl instead of > build_x_array_ref. > * semantics.c (handle_omp_array_sections_1): Adjust grok_array_decl > caller. > gcc/testsuite/ > * g++.dg/cpp2a/comma1.C: Expect different diagnostics for C++23. > * g++.dg/cpp2a/comma3.C: Likewise. > * g++.dg/cpp2a/comma4.C: Expect diagnostics for C++23. > * g++.dg/cpp2a/comma5.C: Expect different diagnostics for C++23. > * g++.dg/cpp23/feat-cxx2b.C: Test __cpp_multidimensional_subscript > predefined macro. > * g++.dg/cpp23/subscript1.C: New test. > * g++.dg/cpp23/subscript2.C: New test. > * g++.dg/cpp23/subscript3.C: New test. > * g++.dg/cpp23/subscript4.C: New test. > * g++.dg/cpp23/subscript5.C: New test. > * g++.dg/cpp23/subscript6.C: New test. Jakub