public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
To: "François Dumont" <frs.dumont@gmail.com>
Cc: "libstdc++@gcc.gnu.org" <libstdc++@gcc.gnu.org>,
	gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] Complete __gnu_test::basic_string<>::compare support
Date: Wed, 12 Oct 2022 12:20:24 +0100	[thread overview]
Message-ID: <CACb0b4n1QGe9z5LRXt1JJUdF8pngqw7V5GbaTq5XM+Q-Uz0kXA@mail.gmail.com> (raw)
In-Reply-To: <ce585743-4426-2774-fe65-a1dbd9ffd517@gmail.com>

On Wed, 10 Aug 2022 at 19:31, François Dumont via Libstdc++
<libstdc++@gcc.gnu.org> 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 <bits/basic_string.h> 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 <debug/string>. This
> way I am testing it using:
>
> make check-debug CXXFLAGS=-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_string
>      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 <debug/string>.
>              *
> 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: Likewise.
>
> Tested under Linux x86_64.
>
> Ok to commit ?

OK. I like the change to how debug strings are tested, thanks.


      reply	other threads:[~2022-10-12 11:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-10 18:31 François Dumont
2022-10-12 11:20 ` 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=CACb0b4n1QGe9z5LRXt1JJUdF8pngqw7V5GbaTq5XM+Q-Uz0kXA@mail.gmail.com \
    --to=jwakely@redhat.com \
    --cc=frs.dumont@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --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).