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.133.124]) by sourceware.org (Postfix) with ESMTPS id 9DA6A3858D20 for ; Tue, 20 Feb 2024 19:27:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9DA6A3858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 9DA6A3858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708457245; cv=none; b=JgONKjCwS0JOZOtukIStzZqwyDsCufIw4h0VnkLLvRqM4OCTr+BnlKYaVuApM8vMZYbNq/SDcjUDzTilL6+fc2yu+vPRHmSdhVMZ9GGYes1nfmFr9d36sZSm6UpvczMielL17IuIH2ROHMcW/ZneeCMPWcRadJnWGgaocYqXyEM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708457245; c=relaxed/simple; bh=7Ztj5u+RBddSWCkGJy0IKoqkwLmq62QAczQIS7xtQmw=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=tA81g5V9FxnWbvV0DAlmfi0LvPgE6hU5CbtX6sdqCmDAS7wWp0fq7MX/fz0O6L3udIC9jT5Ziuz6DNjZ1SguVBJEqC83QprpF4HkVGN87SOzJH2qPEJI47cMqHsTN+IJ/4CWjLOkbq/vXq/XjSfH2v4TJ/eBMuMpZTS+X8gZjT0= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1708457243; 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=RwDTDhPBKLCgbdRjz9iNPRTJP9F/I+Z5JOvpBv48O4g=; b=S0DdL9/XVYwn3XWPx3UlADGNdOfgxUveDytG/twM2WCiD0E2257Ntk2apDXlH9+fagnvgC c3rB25rb69qOucPkRQgIy4NZduAhtVeVSJLlbaQjpl3vf3otJk3WKZQNypbH10wgbJOjat 5IIqbMV4qpcUs2paKx3Yl3aiRSQVW38= Received: from mail-yb1-f198.google.com (mail-yb1-f198.google.com [209.85.219.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-26-TLqvK4mHOPKPGL4bVuI_9w-1; Tue, 20 Feb 2024 14:27:21 -0500 X-MC-Unique: TLqvK4mHOPKPGL4bVuI_9w-1 Received: by mail-yb1-f198.google.com with SMTP id 3f1490d57ef6-dbf216080f5so9219623276.1 for ; Tue, 20 Feb 2024 11:27:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708457241; x=1709062041; 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=RwDTDhPBKLCgbdRjz9iNPRTJP9F/I+Z5JOvpBv48O4g=; b=wV0Y1ryKxy/J/pExscBBWhG6hVnkdBwB8hfzHNZYWfd4JE471BlUR7zHuvxe9k6CGC QcrP1d4+J8T/APh35hqhuauPpBgQKfSlHzmp9+YyoJM3xh50QkCSwOhGA3kcb/+l3Ztm rL5KGaLT3cXMIR7oKlwlB4Y2ifmKx/N6napwgl8hVMlgXYUEMgEbWxrjWT7cPCgALQUe 8zVl+loO53CYYNyqnc2wXUON/cV0kQssEr0BRaqzsdcvW5j+OmW+rnsiGHet7AFD+8O7 kWgnttYwb0rUvYnAaCcoOqmUu+n52QduZ60EAlLf1ghdUaxM9pbmL0usSkvkN4itlkEm EN5Q== X-Forwarded-Encrypted: i=1; AJvYcCXlAKzb+xA5sP9N63pJ1qk1uDR9mwKfmacqyPJArTATdgjyUu0PO/hTgHeE0APFBGbk6pIrUTPzwyKd8ah1p+nX+aXwyNh7gA== X-Gm-Message-State: AOJu0YyIbYcP7Cp972xF7BylXlN+nays9NbWJwnju3NiZM4aFSqc/iTK 9kebutzAj7C6OgE3Im4Qgp6ajRuf6wjs/2ZDYYmR7St7APZJwwi7b0GXdPv5gae6J2MH4iVcs33 ielzz7F/XLu9wQ5lXlkC49o67iIvly9ROuQP0z2trgXmx7MoUgKqpcOwSHfN2FVbXXw1pv4nytd kDJqkja/KvdQi32lmqgxjWRULYr+hrFA== X-Received: by 2002:a25:e210:0:b0:dcd:98bd:7cc8 with SMTP id h16-20020a25e210000000b00dcd98bd7cc8mr14337425ybe.48.1708457240859; Tue, 20 Feb 2024 11:27:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IHyrJ7FKV4+ergQChivzRycAh/XDzrq27ePnF0hP9bYav1XHP+GmFZvUZ7dMUL9vwmb5QjGwyj6Zaq5zdNUQyk= X-Received: by 2002:a25:e210:0:b0:dcd:98bd:7cc8 with SMTP id h16-20020a25e210000000b00dcd98bd7cc8mr14337415ybe.48.1708457240632; Tue, 20 Feb 2024 11:27:20 -0800 (PST) MIME-Version: 1.0 References: <4c78d538-da4d-4a54-987d-3c4257913035@gmail.com> <9a6615ee-0a2c-4bcb-ad13-ba810edb9ee1@gmail.com> <3e1e1652-4320-4b63-a72f-572f045780ca@gmail.com> In-Reply-To: From: Jonathan Wakely Date: Tue, 20 Feb 2024 19:27:04 +0000 Message-ID: Subject: Re: [PATCH][_GLIBCXX_DEBUG] Fix std::__niter_base behavior To: =?UTF-8?Q?Fran=C3=A7ois_Dumont?= Cc: Jonathan Wakely , Stephan Bergmann , "libstdc++" , 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.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE 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 Tue, 20 Feb 2024 at 18:43, Fran=C3=A7ois Dumont wrote: > > libstdc++: [_GLIBCXX_DEBUG] Fix std::__niter_wrap behavior > > In _GLIBCXX_DEBUG mode the std::__niter_base can remove 2 layers, the > __gnu_debug::_Safe_iterator<> and the __gnu_cxx::__normal_iterator<>. > When std::__niter_wrap is called to build a __gnu_debug::_Safe_iterat= or<> > from a __gnu_cxx::__normal_iterator<> we then have a consistency issu= e > as the difference between the 2 iterators will done on a __normal_ite= rator > on one side and a C pointer on the other. To avoid this problem call > std::__niter_base on both input iterators. > > libstdc++-v3/ChangeLog: > > * include/bits/stl_algobase.h (std::__niter_wrap): Add a call= to > std::__niter_base on res iterator. > > Tested under Linux x86_64 normal and _GLIBCXX_DEBUG modes in c++98, c++11= , c++17. > > Ok to commit ? > OK, thanks.