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.129.124]) by sourceware.org (Postfix) with ESMTPS id 763CA3858D28 for ; Tue, 20 Feb 2024 19:27:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 763CA3858D28 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 763CA3858D28 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708457245; cv=none; b=FtIMeA3Cpe6RtDSEJo9DCcQC9sxHX63c3GhH4sv7Jbj7vGMwLAbkOz43IgUoWktK4nnrX9+JN/jG4s0P6iXTz5Ege+dGodFUlGsU7PYLlumqsZueOh8NeuNtRmNT7HGLiK1daM96G+dPJdhuq9nf3s+28MMj4P4uehhqGy0MApE= 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=RUPG8bnr6FD2P8i47tbu8AHibv7+UIvGNItJT9fsZZ28joJZQZRpitaxNFPhWPhi0KgMO9UkYnxm3xliIhN0yRbaMDt7rsi/IGpVsE7pqMQUx3INBovXRSxR0UNCZsEIE0TIhHF4xKPQPsyVCLkrjbrdz5h+BEuUc760gyrmhP4= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1708457244; 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=Cc7qbQXhEm6yg268/08Y3Wpp4ikB/FE2hhBSaZXHsKc1YbGUilQFTRQ+gP2XVDEfsUpUTv GQmnue3WECtUVJVELiWaYsCRyPMkyTxnTJr18EPw14zzTwKxz9a2diH6Wixw3bmtViiag0 q4uGvDtFZpdQycvhFgSXMEIcTl3ehVM= Received: from mail-yb1-f197.google.com (mail-yb1-f197.google.com [209.85.219.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-361-j6JHCxL-PfCvx5vd07E-KA-1; Tue, 20 Feb 2024 14:27:21 -0500 X-MC-Unique: j6JHCxL-PfCvx5vd07E-KA-1 Received: by mail-yb1-f197.google.com with SMTP id 3f1490d57ef6-dc6ceade361so10937189276.0 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=gpwnX2r8mtzhqkU0K9ctS5oUmlT2ZicTXNOOnqjR1oL+oq6+4MLzp5kzUfQ0IiwYGK Y7aioSiiJMOE+qPWKKPhhgGV06IG+vMH7r+dT92BTfiSBGVNeX5d6+CvADo2uBkvowJO hxh8ZJRXZ47kDevWDsQKIE6RY9BjKba5sZL29DmAS3C03C7aJFkJIXoc2wk26BEcoS0V 4NwTNdqwP6jTSOUlyr75NuCC86ku1Clnyv9Jwxo6HMpYvs/vwnhh1CSTtXYndPLY3K7+ wCTSH07knktCReOZsT4qQveopQZmhQk/t9ZW3uwaAK9XTPvvkUkxx5DBSmHRObGfMzwn cHQw== X-Forwarded-Encrypted: i=1; AJvYcCUGqRsfFkJJ1/BuKI+uWZya2hE9/700TBdPO5Uzim2ftJPaNXpU9YsecSUO8y/qnbmt6hwOYe+IwLX7AfaX/dE/kASlzcE= X-Gm-Message-State: AOJu0Ywoh0CR5gZfAyLl8rz50g88mAEASfHnk2FdUg1yic3ZfhRYcfKP +CNjTVVqa4tYqFmmTD6WHHHYE9MP2lb5J2NK9UMbZ0P/RhZPb2WQ+WZ2xvpAnYbqPMrSZSOJPDw 5WczwVR0ESVQvxuEJkyK+yrRPNWBdxtOENjJjMWShiDMFVVgMD9mqNiS+E/dVQeEB5B9gV8nQZ+ hksywGu0VLVHVPLYzmSxIEXec9l74= X-Received: by 2002:a25:e210:0:b0:dcd:98bd:7cc8 with SMTP id h16-20020a25e210000000b00dcd98bd7cc8mr14337426ybe.48.1708457240860; 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_H2,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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.