From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qv1-xf32.google.com (mail-qv1-xf32.google.com [IPv6:2607:f8b0:4864:20::f32]) by sourceware.org (Postfix) with ESMTPS id 470163858406 for ; Mon, 22 Nov 2021 02:51:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 470163858406 Received: by mail-qv1-xf32.google.com with SMTP id m17so11470897qvx.8 for ; Sun, 21 Nov 2021 18:51:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=aBeUgQTxZKV1mHgzw8KvUIOPwY1jH8O1K3FOJ5kj9Fk=; b=aGZCI+1KaWHry0hKdowyy4XZJrfbZ7DzMluRnhsNg0ZJKKDUzPEB1fU210bw6Ygp5R ayq+hTOU9sN8+r/TPsYhvMDEcouXrujqctJ0ujieSnwIPex7remKxe8jLqtb/RWqM2jO djPFcgt7RFUxbS9wGtXkfSY43lnH7VvOdQOmXdFzl2M+ZiXOWZOAyEdZZ+QrkEycethE QeQiC7c4xxva09voVFl3pG/zeBIB55WX95Uxaz+g7o+7x8a5t0oE/uOgKAabBzh06Nao CGkUgb7Qvhhxfwh0FJ3TdWkUQvhJEi9sNbR+EPdRV0ih7+3LAyNfwYM0YD2qGWPZjZdW u12w== X-Gm-Message-State: AOAM532jMoYEzyRzw7gWlMpEYtP/Xw+h0AJxw18O61Dulc41dfJV480M pPiFCjRybVSBwln5HMWF61YMb/iE9vs= X-Google-Smtp-Source: ABdhPJyjVgIzBa3Woaa5SIU/dQiMKmWNNJAzx49lTQ+XJKELWy+3f3RKYD1sKhIWqEeQFb349z+uaw== X-Received: by 2002:a05:6214:411e:: with SMTP id kc30mr97717759qvb.38.1637549491619; Sun, 21 Nov 2021 18:51:31 -0800 (PST) Received: from localhost.localdomain (bras-base-sttnpq8102w-grc-16-142-115-13-133.dsl.bell.ca. [142.115.13.133]) by smtp.googlemail.com with ESMTPSA id t35sm3947822qtc.83.2021.11.21.18.51.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 21 Nov 2021 18:51:31 -0800 (PST) From: Will Wray To: gcc-patches@gcc.gnu.org Cc: Will Wray Subject: [PATCH 0/3] P1997 'array-copy' patchset [PR103238] Date: Sun, 21 Nov 2021 21:51:11 -0500 Message-Id: <20211122025114.3167997-1-wjwray@gmail.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, 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: Mon, 22 Nov 2021 02:51:34 -0000 ([PATCH 1/3] already submitted fix for PR c++/55227, is a dependency here.) These patches implement C++ proposal P1997 "Relaxing restrictions on array" that adds: C array copy semantics: * array-array initializations * array-array assignments * array return-by-value from functions (array formal parameters are unchanged; there's no pass-by-value). Plus, C++ specific: * array pseudo-destructors * array element type deduction (i.e. admitting placeholder auto in array variable declarations). The features are added as an experimental extension, disabled by default. The patches should have no effect until enabled by the new option: -farray-copy (flag_array_copy, a single flag to enable all features) The extension is documented as experimental with no guarantee of stability; features may be added, removed or changed in detail. In particular, there's no guarantee of ABI stability; allowing array as a function return type has ABI implications for calling conventions of the array return slot and, for C++, name-mangling conventions must be defined. The plan is to first merge array-copy as experimental, with ABI defined as 'what the code does', and then to go ahead with ABI work. Will Wray (3): c++: designated init of char array by string constant [PR55227] c++: P1997 array-copy extensions: Initialization [PR103238] c++: P1997 array-copy extensions: Assignment, return, etc. [PR103238] gcc/c-family/c-common.c | 5 ++ gcc/c-family/c.opt | 4 ++ gcc/c/c-decl.c | 2 +- gcc/cp/call.c | 43 +++++++----- gcc/cp/decl.c | 111 ++++++++++++++++++------------- gcc/cp/init.c | 6 +- gcc/cp/parser.c | 4 +- gcc/cp/pt.c | 13 +++- gcc/cp/tree.c | 3 +- gcc/cp/typeck.c | 35 ++++++++-- gcc/cp/typeck2.c | 30 ++++++--- gcc/doc/invoke.texi | 6 ++ gcc/testsuite/g++.dg/cpp2a/desig20.C | 48 +++++++++++++ gcc/testsuite/g++.dg/init/array-copy1.C | 66 ++++++++++++++++++ gcc/testsuite/g++.dg/init/array-copy10.C | 57 ++++++++++++++++ gcc/testsuite/g++.dg/init/array-copy11.C | 13 ++++ gcc/testsuite/g++.dg/init/array-copy12.C | 79 ++++++++++++++++++++++ gcc/testsuite/g++.dg/init/array-copy2.C | 68 +++++++++++++++++++ gcc/testsuite/g++.dg/init/array-copy3.C | 41 ++++++++++++ gcc/testsuite/g++.dg/init/array-copy4.C | 42 ++++++++++++ gcc/testsuite/g++.dg/init/array-copy5.C | 36 ++++++++++ gcc/testsuite/g++.dg/init/array-copy6.C | 51 ++++++++++++++ gcc/testsuite/g++.dg/init/array-copy7.C | 40 +++++++++++ gcc/testsuite/g++.dg/init/array-copy8.C | 56 ++++++++++++++++ gcc/testsuite/g++.dg/init/array-copy9.C | 57 ++++++++++++++++ 25 files changed, 835 insertions(+), 81 deletions(-) create mode 100644 gcc/testsuite/g++.dg/cpp2a/desig20.C create mode 100644 gcc/testsuite/g++.dg/init/array-copy1.C create mode 100644 gcc/testsuite/g++.dg/init/array-copy10.C create mode 100644 gcc/testsuite/g++.dg/init/array-copy11.C create mode 100644 gcc/testsuite/g++.dg/init/array-copy12.C create mode 100644 gcc/testsuite/g++.dg/init/array-copy2.C create mode 100644 gcc/testsuite/g++.dg/init/array-copy3.C create mode 100644 gcc/testsuite/g++.dg/init/array-copy4.C create mode 100644 gcc/testsuite/g++.dg/init/array-copy5.C create mode 100644 gcc/testsuite/g++.dg/init/array-copy6.C create mode 100644 gcc/testsuite/g++.dg/init/array-copy7.C create mode 100644 gcc/testsuite/g++.dg/init/array-copy8.C create mode 100644 gcc/testsuite/g++.dg/init/array-copy9.C -- 2.31.1