public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 0/3] P1997 'array-copy' patchset [PR103238]
@ 2021-11-22  2:51 Will Wray
  2021-11-22  2:51 ` [PATCH 1/3] c++: designated init of char array by string constant [PR55227] Will Wray
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Will Wray @ 2021-11-22  2:51 UTC (permalink / raw)
  To: gcc-patches; +Cc: Will Wray

([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


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-11-29 22:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-22  2:51 [PATCH 0/3] P1997 'array-copy' patchset [PR103238] Will Wray
2021-11-22  2:51 ` [PATCH 1/3] c++: designated init of char array by string constant [PR55227] Will Wray
2021-11-25 16:05   ` Jason Merrill
2021-11-22  2:51 ` [PATCH 2/3] c++: P1997 array-copy extensions: Initialization [PR103238] Will Wray
2021-11-27 22:56   ` Jason Merrill
2021-11-22  2:51 ` [PATCH 3/3] c++: P1997 array-copy extensions: Assignment, return, etc. [PR103238] Will Wray
2021-11-22 20:41   ` Joseph Myers
2021-11-22 21:21     ` will wray
2021-11-29 22:44   ` Jason Merrill

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).