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 0B1143858C52 for ; Wed, 31 Aug 2022 09:25:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0B1143858C52 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1661937951; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tqTyfhR9tkQ6KzqMIVPp/7sMkXvQI45JTtgOidO3WVc=; b=grfZBlBJb7SPLNSW3kWYEK24TwP1nqAID/e/w1dMrq2w6LDqWiJSCtgCDZFDS530nVZjbg iQrfnIL5tiq8WEg2iT0dP8wMAwK/1e36sduH/N3O3h4E6aAAAOcMF4IeCYAeZ/ZQCtOyJb nkfOsbABrIVze02r4e9oY1TGAaZoMws= Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-226-zSrgA8aJNr2gFTOf-J8sPQ-1; Wed, 31 Aug 2022 05:25:50 -0400 X-MC-Unique: zSrgA8aJNr2gFTOf-J8sPQ-1 Received: by mail-qk1-f198.google.com with SMTP id bl16-20020a05620a1a9000b006bc3aa1908dso11327340qkb.15 for ; Wed, 31 Aug 2022 02:25:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc; bh=tqTyfhR9tkQ6KzqMIVPp/7sMkXvQI45JTtgOidO3WVc=; b=Fm8syCOp3hBbvcjExK3avb+94nj3v1Ew4iCitufxaFM3ekeknQNG0jOLrn+m+KlRb8 vZsgRWNXjWA8xVYpG30zXuS2f10Jp0mnoThqExfhfrNbR77P4aQqXNG3FGE2SC7x82pE yWWCFQ7BgwpAWAKGqzVQoLY9W6hn+J76HLa3mEUj0akd4mZQB+pf8nuKDQ8SywaEmQcw PQ9ZuXjZShab7JifIUD5IWbBPxtTCR/KMRBKLE49Z6CCdOJ24JkrfG40IqB2lDhra2s2 CjCTDQ89uZ6CK2Tkote5WabxhSaZ5RaTSC/trxOY4NuSm7e4j6QwYrs2JkLTlh5LWTt6 Ujew== X-Gm-Message-State: ACgBeo0S4z0356qPbIwwO+/MbC9uj5ErHtfPkVjD/DBUnsh+iRXGPHo5 FvBHa4YapAriOkGcXMkTLQFZ7bTtNbxlh3h6i/npoZOZAbEupQNmyW9VPTfB0yrIpRp/Yzb4eOt oEWP1XVkqEgfVfpfrSVCRp02usFveEqz3wQ== X-Received: by 2002:a05:620a:884:b0:6bc:2056:1005 with SMTP id b4-20020a05620a088400b006bc20561005mr14804511qka.293.1661937950068; Wed, 31 Aug 2022 02:25:50 -0700 (PDT) X-Google-Smtp-Source: AA6agR47Jpz7jUdv35lTnsSVlHiTZTZeDChlfsPppEfekigT+oeOy6ghExkFoN7WkQcvBY/i7kt7mqnuZ/Y9FucKGoM= X-Received: by 2002:a05:620a:884:b0:6bc:2056:1005 with SMTP id b4-20020a05620a088400b006bc20561005mr14804505qka.293.1661937949839; Wed, 31 Aug 2022 02:25:49 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Jonathan Wakely Date: Wed, 31 Aug 2022 10:25:39 +0100 Message-ID: Subject: Re: [PATCH][_GLIBCXX_DEBUG] Review null string assertions (was: Add basic_string::starts_with/ends_with checks) To: =?UTF-8?Q?Fran=C3=A7ois_Dumont?= Cc: "libstdc++@gcc.gnu.org" , gcc-patches X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Wed, 31 Aug 2022 at 05:38, Fran=C3=A7ois Dumont w= rote: > > If I got your point correctly here is this patch again with just the > change on '0' becoming 'nullptr' in assertions. > > libstdc++: [_GLIBCXX_DEBUG] Review nullptr assertion diagnostics > > Review null string checks to show: > _String !=3D nullptr > > rather than: > _String !=3D 0 > > libstdc++-v3/ChangeLog: > > * include/debug/debug.h: Use nullptr rather than '0' in > checks in post-C++11. > * include/debug/string: Likewise. > * > testsuite/21_strings/basic_string/operations/ends_with/char.cc: Use > __gnu_test::string. > * > testsuite/21_strings/basic_string/operations/ends_with/nonnull.cc: Likewi= se. > * > testsuite/21_strings/basic_string/operations/ends_with/wchar_t.cc: Likewi= se. > * > testsuite/21_strings/basic_string/operations/starts_with/wchar_t.cc: > Likewise. > * > testsuite/21_strings/basic_string/operations/starts_with/nonnull.cc: > Likewise. > * > testsuite/21_strings/basic_string/operations/starts_with/char.cc: Likewis= e.. > > Ok to commit ? The testsuite changes seem unrelated to the actual code change, so I'd have done a separate patch. But OK for trunk.