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 E47C83858003 for ; Tue, 16 Nov 2021 16:57:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E47C83858003 Received: from mail-yb1-f199.google.com (mail-yb1-f199.google.com [209.85.219.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-332-xFU4uKIAPnCGl4EyjSQCmA-1; Tue, 16 Nov 2021 11:57:01 -0500 X-MC-Unique: xFU4uKIAPnCGl4EyjSQCmA-1 Received: by mail-yb1-f199.google.com with SMTP id s189-20020a252cc6000000b005c1f206d91eso32913252ybs.14 for ; Tue, 16 Nov 2021 08:57:01 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wfwyCij25ohTdF2xgMZsc+N0JNddAtj6MMWsVFBTFhI=; b=gP4TJHp+lul0hyUajbSdkwf2t96EtbFxP34fmyvo5iv1hx4ngsxC4F7u2i9NYob279 tCNCsRvKXDrOdzBr47UZhR/7EkP/tPewQAOvCQN2rgbFCXlbi+cSVx0iCZ46UvT7Lsxz 957T0ouLTlfoJhtOoaM06N4BO71ypP1kcunUAY4mlUwVNwLXHrKOdw7J9rVc26raH7I/ hZ0nz1wcc8PhrFqSQBIuXxmRiJIGxootkULfoNA19bm5YR1c6f1UA6mZD5khAfOVW2Fm HdoYdXxQt29kR3usFJSKmJjnLw6tmFupUGP7kj/h5Ae/dgOoViwDjN4A3BeYzL18ujmk tzLg== X-Gm-Message-State: AOAM533CIyhw4sVqa/EQSmLiDoRJZTV5toDiQsp/wWEq5w0Et2+FcH76 XHBmYWKHwDC1j7scatFLc4ZEmLpZnHmYQa/TILLUPfiga9Ko3L4Ln60C8vGUm+h4T4i8llcwVkS rrNroRZtSmLOJCpmimS5iS7iosWV/xRU= X-Received: by 2002:a25:c844:: with SMTP id y65mr9621937ybf.190.1637081821455; Tue, 16 Nov 2021 08:57:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJyvVaevdFjPSqn2nsgRqBvXCz8hk6znscSMI3m5dIz2aqVgdCIbV3KrBaQYW1VVMSym1ZJzPDdLFR2r0+dLLOE= X-Received: by 2002:a25:c844:: with SMTP id y65mr9621898ybf.190.1637081821177; Tue, 16 Nov 2021 08:57:01 -0800 (PST) MIME-Version: 1.0 References: <20211116164527.3872136-2-jwakely@redhat.com> In-Reply-To: <20211116164527.3872136-2-jwakely@redhat.com> From: Jonathan Wakely Date: Tue, 16 Nov 2021 16:56:50 +0000 Message-ID: Subject: Re: [committed 2/2] libstdc++: Implement constexpr std::basic_string for C++20 To: Jonathan Wakely Cc: "libstdc++" , gcc Patches , Michael de Lang X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, HTML_MESSAGE, KAM_NUMSUBJECT, KAM_SHORT, 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 Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Nov 2021 16:57:14 -0000 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. > > >