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] libstdc++/98466 Fix _GLIBCXX_DEBUG N3644 integration
Date: Thu, 14 Jan 2021 17:10:03 +0000 [thread overview]
Message-ID: <20210114171003.GI7692@redhat.com> (raw)
In-Reply-To: <9c1f5008-1ded-fed1-bc57-309ec74b9c77@gmail.com>
On 01/01/21 18:51 +0100, François Dumont via Libstdc++ wrote:
>I think the PR is not limited to unordered containers iterator, it
>impacts all _GLIBCXX_DEBUG iterators.
>
>However unordered containers local_iterator was more complicated to
>handle. Because of c++/65816 I prefer to review _Node_iterator_default
>constructor to set _M_cur to nullptr even if in principle it is not
>necessary except for the _Local_iterator_base constructor when hash
>code is not cached.
>
>Â Â Â libstdc++: Implement N3644 for _GLIBCXX_DEBUG iterators
>
>Â Â Â libstdc++-v3/ChangeLog
>
>Â Â Â Â Â Â Â Â Â Â Â PR libstdc++/98466
>Â Â Â Â Â Â Â Â Â Â Â * include/bits/hashtable_policy.h (_Node_iterator_base()):
>Set _M_cur to nullptr.
>Â Â Â Â Â Â Â Â Â Â Â (_Node_iterator()): Make default.
>Â Â Â Â Â Â Â Â Â Â Â (_Node_const_iterator()): Make default.
>Â Â Â Â Â Â Â Â Â Â Â * include/debug/macros.h
>(__glibcxx_check_erae_range_after): Add _M_singular
>Â Â Â Â Â Â Â Â Â Â Â iterator checks.
>Â Â Â Â Â Â Â Â Â Â Â * include/debug/safe_iterator.h
>Â Â Â Â Â Â Â Â Â Â Â (_GLIBCXX_DEBUG_VERIFY_OPERANDS): Accept if both iterator
>are value initialized.
>Â Â Â Â Â Â Â Â Â Â Â * include/debug/safe_local_iterator.h
>(_GLIBCXX_DEBUG_VERIFY_OPERANDS):
>Â Â Â Â Â Â Â Â Â Â Â Likewise.
>Â Â Â Â Â Â Â Â Â Â Â * include/debug/safe_iterator.tcc
>(_Safe_iterator<>::_M_valid_range): Add
>Â Â Â Â Â Â Â Â Â Â Â _M_singular checks on input iterators.
>Â Â Â Â Â Â Â Â Â Â Â * src/c++11/debug.cc
>(_Safe_iterator_base::_M_can_compare): Remove _M_singular
>Â Â Â Â Â Â Â Â Â Â Â checks.
>Â Â Â Â Â Â Â Â Â Â Â * testsuite/23_containers/deque/debug/98466.cc: New test.
>Â Â Â Â Â Â Â Â Â Â Â * testsuite/23_containers/unordered_map/debug/98466.cc:
>New test.
>
>Tested under Linux x86_64 normal and debug mode.
>
>Ok to commit ?
Yes, thanks.
One question about the deque test ...
>diff --git a/libstdc++-v3/testsuite/23_containers/deque/debug/98466.cc b/libstdc++-v3/testsuite/23_containers/deque/debug/98466.cc
>new file mode 100644
>index 00000000000..720977e5622
>--- /dev/null
>+++ b/libstdc++-v3/testsuite/23_containers/deque/debug/98466.cc
>@@ -0,0 +1,38 @@
>+// Copyright (C) 2021 Free Software Foundation, Inc.
>+//
>+// This file is part of the GNU ISO C++ Library. This library is free
>+// software; you can redistribute it and/or modify it under the
>+// terms of the GNU General Public License as published by the
>+// Free Software Foundation; either version 3, or (at your option)
>+// any later version.
>+
>+// This library is distributed in the hope that it will be useful,
>+// but WITHOUT ANY WARRANTY; without even the implied warranty of
>+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
>+// GNU General Public License for more details.
>+
>+// You should have received a copy of the GNU General Public License along
>+// with this library; see the file COPYING3. If not see
>+// <http://www.gnu.org/licenses/>.
>+
>+// { dg-do run { target c++11 } }
Does this need to be limited to c++11 and later? Could it just use
{ dg-do run } instead?
OK to commit anyway, thanks.
next prev parent reply other threads:[~2021-01-14 17:10 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-01 17:51 François Dumont
2021-01-14 17:10 ` Jonathan Wakely [this message]
2021-01-14 17:15 ` Jonathan Wakely
2021-01-14 18:34 ` François Dumont
2021-01-14 18:33 ` François Dumont
2021-01-14 19:20 ` Jonathan Wakely
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=20210114171003.GI7692@redhat.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).