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 DC4623858280 for ; Wed, 31 Aug 2022 09:25:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DC4623858280 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=1661937953; 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=OspedQfi8tJh1gVC4vbYlmDK+b+w/4uJmXuBAkG+jS6bX2VimfVWv4Y1tXakYMYLcIyXWN euB8UoBHs84gXFGicnph7/S6CUWtwYpdM6qx5lAgFnuIIM6G8u+Xf0QsAeAmck6fgXYx72 sh5BiH17NdcqwyfyiNvK3kd2sr3aAuI= Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-538-PBlDR_srN9y89JbmBBLCdw-1; Wed, 31 Aug 2022 05:25:50 -0400 X-MC-Unique: PBlDR_srN9y89JbmBBLCdw-1 Received: by mail-qt1-f198.google.com with SMTP id h13-20020ac87d4d000000b00342f6c363afso10721488qtb.9 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=WZr2Q/hX/Nc54R6zPvwnA+CMO9iQ7phHUPVN78S4TO/kECHTu8FeayuqEyy5zT1sbS O9wd7yM7caUSJUyUL3EcHDZuH4244QfUK0p3ih4ctuEIQtrlXh0I9xnBhFMWBntJeeWN vz3ozkggkwrGU117fQNQYluH4Bn9/CVPwNk8cksmS/Xrt1G3B1jktDbMX3dI5CUiURU+ 7wf5UNCeIrJ9YeDwsGxjHxYLMHNuLOSunNpxSs1eQ5Nn7uDVwzxAk9gpgeRUK/Klh6aw eMLl1OE3uGavalbgwhs0w3tQBMsvYmnuUE5zAxBXUqzTLj4LoRD6devq+SB8aTNwjwIt wEUA== X-Gm-Message-State: ACgBeo3wEP1Dh627RzrKLu2t/Vhi0eCCsrJy4/hZA+g2jQHffxB2Mq3f feidzwH8xpIjLf+ro3ZucXnJmboFCQxMAtvYaOxjMTpA3FMJJwYNi2+TQPL7jPM19p1wczqV/fm KEWzV3gkiX1QEsyxHo1HH7WB4ptmyf9g= X-Received: by 2002:a05:620a:884:b0:6bc:2056:1005 with SMTP id b4-20020a05620a088400b006bc20561005mr14804510qka.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.4 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=unavailable 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.