public inbox for
 help / color / mirror / Atom feed
From: "François Dumont" <>
To: Jonathan Wakely <>
Cc: "" <>,
	gcc-patches <>
Subject: Re: [PATCH] Complete __gnu_debug::basic_string Standard conformity
Date: Tue, 19 Jul 2022 20:08:17 +0200	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

On 19/07/22 12:42, Jonathan Wakely wrote:
> On Sun, 10 Jul 2022 at 14:57, François Dumont via Libstdc++
> <> wrote:
>> Here is a first patch to complete __gnu_debug::basic_string Standard
>> conformity.
>> I prefer to submit this before checking for more missing stuff to check
>> that my proposal of having a testsuite_string.h header is ok.
> I think this change means some testcases will never test std::string
> with _GLIBCXX_DEBUG defined, because if that is defined they test
> __gnu_debug::string instead. That means assertions in
> std::basic_string like this one will not get tested:
>    template<typename _CharT, typename _Traits, typename _Alloc>
>      typename basic_string<_CharT, _Traits, _Alloc>::size_type
>      basic_string<_CharT, _Traits, _Alloc>::
>      find(const _CharT* __s, size_type __pos, size_type __n) const
>      {
>        __glibcxx_requires_string_len(__s, __n);
> Are we OK with never testing those assertions?

> Currently they don't get tested by default because of the extern
> template declarations for std::string, so they would only be tested
> don't test routinely. So I suppose this change doesn't make things any
> worse in practice.
Good point, I'll try to activate those asserts with just 
_GLIBCXX_ASSERTIONS so that we will still be able to test despite my change.
>> I also noticed some problems with _GLIBCXX_DEBUG_PEDANTIC.
>>       libstdc++: Complete __gnu_debug::string Standard conformity
>>       Add testsuite/testsuite_string.h header to help testing
>> __gnu_debug::basic_string like
>>       std::basic_string depending on _GLIBCXX_DEBUG.
>>       Add using of base type methods in __gnu_debug::basic_string to make
>> use of the method
>>       overloads when there is no debug version.
>>       Fix _GLIBCXX_DEBUG_PEDANTIC assertions in <debug/string>. This
>> header has to be used directly
>>       like __gnu_debug::string, it is not included by _GLIBCXX_DEBUG. It
>> means that
>>       _GLIBCXX_DEBUG_PEDANTIC is not considered to define
>> __glibcxx_check_string and
>>       __glibcxx_check_string_len which are then empty macros. Now those
>> macros are defined
>>       directly in <debug/string> and properly consider
> Nice catch.

Yes, I forgot to signal that before this patch some tests were XFAIL in 
segfault rather than with the proper _GLIBCXX_DEBUG_PEDANTIC assertion.

> OK for trunk, thanks.
Ok, committed.

      reply	other threads:[~2022-07-19 18:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-10 13:56 François Dumont
2022-07-19 10:42 ` Jonathan Wakely
2022-07-19 18:08   ` François Dumont [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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \

* 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).