From: Jonathan Wakely <jwakely@redhat.com>
To: Jonathan Wakely <jwakely@redhat.com>
Cc: "libstdc++" <libstdc++@gcc.gnu.org>,
gcc Patches <gcc-patches@gcc.gnu.org>,
Michael de Lang <kingoipo@gmail.com>
Subject: Re: [committed 2/2] libstdc++: Implement constexpr std::basic_string for C++20
Date: Tue, 16 Nov 2021 16:56:50 +0000 [thread overview]
Message-ID: <CACb0b4mVbEjHfEV8E8H6vNMoavGh_UC+N0n8LYjXDyiWMb9Kvw@mail.gmail.com> (raw)
In-Reply-To: <20211116164527.3872136-2-jwakely@redhat.com>
Oops, the subject line was not supposed to say 2/2 for this commit, and I
was not supposed to have Michael de Lang as the author ... I messed up my
git send-email and git cherry-pick commands!
Sorry Michael, I originally tried to use your tests from
https://github.com/Oipo/gcc/ but as noted in https://gcc.gnu.org/PR93989
those tests are incorrect, and so I didn't actually use any of them (nor
the std::string code itself). But apparently the commit still had you as
the author, because I reset the content of the git tree, but not the commit
author. I'll fix that in GCC's ChangeLog file after it regenerates
overnight.
On Tue, 16 Nov 2021 at 16:47, Jonathan Wakely wrote:
> From: Michael de Lang
>
> Tested x86_64-linux, committed to trunk.
>
>
> This is only supported for the cxx11 ABI, not for COW strings.
>
> libstdc++-v3/ChangeLog:
>
> * include/bits/basic_string.h (basic_string, operator""s): Add
> constexpr for C++20.
> (basic_string::basic_string(basic_string&&)): Only copy
> initialized portion of the buffer.
> (basic_string::basic_string(basic_string&&, const Alloc&)):
> Likewise.
> * include/bits/basic_string.tcc (basic_string): Add constexpr
> for C++20.
> (basic_string::swap(basic_string&)): Only copy initialized
> portions of the buffers.
> (basic_string::_M_replace): Add constexpr implementation that
> doesn't depend on pointer comparisons.
> * include/bits/cow_string.h: Adjust comment.
> * include/ext/type_traits.h (__is_null_pointer): Add constexpr.
> * include/std/string (erase, erase_if): Add constexpr.
> * include/std/version (__cpp_lib_constexpr_string): Update
> value.
> * testsuite/21_strings/basic_string/cons/char/constexpr.cc:
> New test.
> * testsuite/21_strings/basic_string/cons/wchar_t/constexpr.cc:
> New test.
> * testsuite/21_strings/basic_string/literals/constexpr.cc:
> New test.
> * testsuite/21_strings/basic_string/modifiers/constexpr.cc: New
> test.
> *
> testsuite/21_strings/basic_string/modifiers/swap/char/constexpr.cc:
> New test.
> *
> testsuite/21_strings/basic_string/modifiers/swap/wchar_t/constexpr.cc:
> New test.
> * testsuite/21_strings/basic_string/version.cc: New test.
>
>
>
prev parent reply other threads:[~2021-11-16 16:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-16 16:45 Jonathan Wakely
2021-11-16 16:56 ` Jonathan Wakely [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CACb0b4mVbEjHfEV8E8H6vNMoavGh_UC+N0n8LYjXDyiWMb9Kvw@mail.gmail.com \
--to=jwakely@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=kingoipo@gmail.com \
--cc=libstdc++@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).