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.129.124]) by sourceware.org (Postfix) with ESMTPS id AD1F23851403 for ; Wed, 12 Oct 2022 11:20:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AD1F23851403 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=1665573636; 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=OL2OXZEuBpIrJhHnfHpAuD9irFinXsKFtOF2mE3F4vw=; b=EZUKDduI6RDOShcM7k+1wN3r6xnVlPlpeBkVq8E7H50TeM74HXS3n3vaQg+0typoAwV+04 /XoZ2zgfMCXJ3NlUObhNXkXk6RR+OUAMFBdsmwxsiUtNhm1bie/20dGGAOwQKFyIojBzkB CIyXXUm8bTj7pPA4mwgDA9Dzxz6Pw5I= Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-97-wRKdkWAwMhOlsFPy5imsuw-1; Wed, 12 Oct 2022 07:20:35 -0400 X-MC-Unique: wRKdkWAwMhOlsFPy5imsuw-1 Received: by mail-qk1-f200.google.com with SMTP id t1-20020a05620a450100b006ee79ceeb6fso4055316qkp.11 for ; Wed, 12 Oct 2022 04:20:35 -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 :subject:date:message-id:reply-to; bh=OL2OXZEuBpIrJhHnfHpAuD9irFinXsKFtOF2mE3F4vw=; b=kIIburODaF5tbv77K/Yepej2p1kEb7EckQ2jjvEwleikD1PXmjQ2hgYp0EBLmaaIu5 OPxhDINvk1hnTVFivtIuPs09b9YoVMqFZ13T4ZzxFLip0XFs2vh3F7OjLi90dBiZGUAs SS7zcLLoLxKvVPRTQ2+AiUvwKxF/DWTUYcufp/yrDwhfd5bh78c2BaQS2WxNc0ZQMOdv D0a1RBenSUw6tbuOfvLt6pmbaUKe5/AmJG3LKgdRbF/8Q16q5i6QYCOQW+raYx5zPNmi kL91mMclfT4oEYFiMW2RR3UF21cjI4QrCWHDlsD24voAQcXCrWzk2XOqPp3GpKvn9eUt malA== X-Gm-Message-State: ACrzQf0fXklI/IOEnD/fK6/LX4YN9FMUsiDyatlC7g5V0jExA82EGxPD fnjjbmBVRCgGY6e6UevaPhKkUsWq1FjosJ/C1M+Zd6g/rlhEPht/DuZk4P3jZeEAynh5hRJ+jDh hsu8yNipWgNGlh79Qw5AVxOjJdYOtVesq0g== X-Received: by 2002:a0c:9a0d:0:b0:4b1:982e:96d4 with SMTP id p13-20020a0c9a0d000000b004b1982e96d4mr21847461qvd.114.1665573635404; Wed, 12 Oct 2022 04:20:35 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4yc2ReD+zhtQqLjZwLbOrg691UlGGD8sjt4OML25gd5b0XQLlHGvzgM3dN/55w2ZwZY7nC84oJq0cP6iGk/30= X-Received: by 2002:a0c:9a0d:0:b0:4b1:982e:96d4 with SMTP id p13-20020a0c9a0d000000b004b1982e96d4mr21847445qvd.114.1665573635163; Wed, 12 Oct 2022 04:20:35 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Jonathan Wakely Date: Wed, 12 Oct 2022 12:20:24 +0100 Message-ID: Subject: Re: [PATCH] Complete __gnu_test::basic_string<>::compare support 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 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, 10 Aug 2022 at 19:31, Fran=C3=A7ois Dumont via Libstdc++ wrote: > > Here is another patch to complete __gnu_debug::basic_string<> Standard > conformity. This one is adding the missing compare overloads. > > I also would like to propose to change how __gnu_debug::basic_string<> > is tested. I considered activating checks when > _GLIBCXX_ASSERTIONS is defined but it turns out that to do so this > light-debug mode should then also consider _GLIBCXX_DEBUG_PEDANTIC. I > prefer to avoid this. > > So I restored previous behavior. I'm now checking for the > _GLIBCXX_TEST_DEBUG_STRING macro to force usage of . This > way I am testing it using: > > make check-debug CXXFLAGS=3D-D_GLIBCXX_TEST_DEBUG_STRING > > libstdc++: Add __gnu_debug::basic_string<>::compare overloads > > Rather than adding those implementations we are ading a: > using _Base::compare; > > so that any compare method not implemented at __gnu_debug::basic_str= ing > level are injected from the base class. > > Also review how __gnu_debug::basic_string is tested. Now require to > define > _GLIBCXX_TEST_DEBUG_STRING when running 'make check-debug'. > > libstdc++-v3/ChangeLog > > * include/debug/string: Add using _Base::compare. > (__gnu_debug::basic_string<>::compare(const > basic_string<>&)): Remove. > (__gnu_debug::basic_string<>::compare(size_type, size_type, > const basic_string<>&)): > Remove. > (__gnu_debug::basic_string<>::compare(size_type, size_type, > const basic_string<>&, > size_type, size_type)): Remove. > * testsuite/util/testsuite_string.h > [_GLIBCXX_TEST_DEBUG_STRING]: Include . > * > testsuite/21_strings/basic_string/operations/compare/char/1.cc: Include > testsuite_string.h > and use __gnu_test::string. > * > testsuite/21_strings/basic_string/operations/compare/char/13650.cc: > Likewise. > * > testsuite/21_strings/basic_string/operations/compare/char/2.cc: Likewise. > * > testsuite/21_strings/basic_string/operations/rfind/char/1.cc: Likewise. > * > testsuite/21_strings/basic_string/operations/rfind/char/2.cc: Likewise. > * > testsuite/21_strings/basic_string/operations/rfind/char/3.cc: Likewise. > * > testsuite/21_strings/basic_string/operations/compare/wchar_t/1.cc: > Include testsuite_string.h > and use __gnu_test::wstring. > * > testsuite/21_strings/basic_string/operations/compare/wchar_t/13650.cc: > Likewise. > * > testsuite/21_strings/basic_string/operations/compare/wchar_t/2.cc: Likewi= se. > > Tested under Linux x86_64. > > Ok to commit ? OK. I like the change to how debug strings are tested, thanks.