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 [216.205.24.124]) by sourceware.org (Postfix) with ESMTPS id C7EC63858404 for ; Wed, 10 Nov 2021 09:38:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C7EC63858404 Received: from mail-yb1-f200.google.com (mail-yb1-f200.google.com [209.85.219.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-563-LE9GE4HhO4yPnDcIcaRhGA-1; Wed, 10 Nov 2021 04:38:31 -0500 X-MC-Unique: LE9GE4HhO4yPnDcIcaRhGA-1 Received: by mail-yb1-f200.google.com with SMTP id s189-20020a252cc6000000b005c1f206d91eso3126729ybs.14 for ; Wed, 10 Nov 2021 01:38:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=hsBLteZYz2pLGspGc4PcXbDQSxqmFWpcI37rZGGJZFo=; b=Djekd17Resigs1lNV3IlYk8qs7+CWIrvQ2vU6Nm0/57TW3xFT+2rIbIFb9ktj9XvwS +3qGqjyvSHgaRxg52fxBG70JJhH+ID6MrDGWwDwa0Y6ZMpeoarJ/rstpQ3M+ye5JvUZE po3itH/eA/sQJTJmMus+r/EavL86qrgS+lmJ8JPCyFGeWSc6xU35Y5jHYmHJkqhEVIHw 6vocVbEfLuoo0S110fL/lGsYYWYaUg/Y3ANhXobdp/vEeOSlMIPnn3JBD/BOpsrtevdl GhqzSRSgfZ0RwrsRTTnbNIugeQKoJvOJAN0/HwkcWJhuq6buwv+kDsDzMNk/0ZvoqXyC WdDw== X-Gm-Message-State: AOAM531V/R17eD1rP7S+HdI0FpI9nXa4d1QhPSzyZobeHpCwooI1K64V VncOwvZrSgSWDzbC3JHSaRaStookjK48bJqo0oef6+TZZIGCoaJ2L1sZbtd/nEHnX0dnX3P9d7j s9LL1bTdzstR4XCua1aMtpOS8jQ6aGs4= X-Received: by 2002:a25:a0c8:: with SMTP id i8mr15495783ybm.322.1636537111274; Wed, 10 Nov 2021 01:38:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJweeXgp9pc2YXoHTiAs1zGmtC5S7og+rfui3mpUOj2mlIGxmnv+/HlgqwlZR004gtcDDPzkJ+Ki2Ucf1VdJxsA= X-Received: by 2002:a25:a0c8:: with SMTP id i8mr15495761ybm.322.1636537111011; Wed, 10 Nov 2021 01:38:31 -0800 (PST) MIME-Version: 1.0 References: <4eec3fb9-851e-3e4e-f9f4-1110db3af747@gmail.com> <6c349652-8b6f-2027-08c3-6ce58a765aeb@gmail.com> <22bf1b42-8cf4-7a6e-d5dc-c322ccbb2b46@gmail.com> <68641ea0-2a14-e3a5-8315-a7b3a9c1fdb4@gmail.com> <3c792e6f-6ee7-200f-84bd-0eb56281888b@gmail.com> In-Reply-To: <3c792e6f-6ee7-200f-84bd-0eb56281888b@gmail.com> From: Jonathan Wakely Date: Wed, 10 Nov 2021 09:38:19 +0000 Message-ID: Subject: Re: [PATH][_GLIBCXX_DEBUG] Fix unordered container merge To: =?UTF-8?Q?Fran=C3=A7ois_Dumont?= Cc: Jonathan Wakely , "libstdc++" , gcc-patches X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, HTML_MESSAGE, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Nov 2021 09:38:44 -0000 On Wed, 10 Nov 2021 at 05:47, Fran=C3=A7ois Dumont w= rote: > On 09/11/21 5:25 pm, Jonathan Wakely wrote: > > > > On Mon, 8 Nov 2021 at 21:36, Fran=C3=A7ois Dumont = wrote: > >> Yet another version this time with only 1 guard implementation. The >> predicate to invalidate the safe iterators has been externalized. >> >> Ok to commit ? >> > > I like this version a lot - thanks for persisting with it. > > OK to commit, thanks. > > > As an aside ... > > --- a/libstdc++-v3/testsuite/util/testsuite_abi.h > +++ b/libstdc++-v3/testsuite/util/testsuite_abi.h > @@ -24,7 +24,11 @@ > #include > #if __cplusplus >=3D 201103L > # include > +# ifdef _GLIBCXX_DEBUG > +namespace unord =3D std::_GLIBCXX_STD_C; > +# else > namespace unord =3D std; > +# endif > #else > # include > namespace unord =3D std::tr1; > > > Several times I've been annoyed by the fact that we don't have a way to > refer to std::_GLIBCXX_STD_C::vector etc. that is always valid, in normal > mode and debug mode. > > Maybe we should add: > > namespace std { namespace _GLIBCXX_STD_C =3D ::std; } > > That way we can refer to std::_GLIBCXX_STD_C::foo in normal mode, and it > will mean the same thing as in debug mode. So we don't need to use #if > conditions like this. > > > Good idea, I'll prepare it. > Alternatively we could do this: namespace std { namespace __cxx1998 { } #ifdef _GLIBCXX_DEBUG namespace __cont =3D __cxx1998; #else namespace __cont =3D ::std:: #endif } And then define this so it's always the same name: #define _GLIBCXX_STD_C __cont Then we can refer to std::_GLIBCXX_STD_C::vector in any context, and it refers to the right thing. And we could also stop using the SHOUTING macro, and just refer to std::__cont::vector instead. We could also make this work as std::__cxx1998::vector, but maybe we should move away from the "1998" name, because it doesn't make much sense for forward_list and unordered_map which are not in C++98.