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 3B684385E006 for ; Wed, 14 Feb 2024 19:44:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3B684385E006 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 3B684385E006 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=1707939880; cv=none; b=wFMi+axLrESMGJTRNdBVxLPt+stww7p0qHNxs71QKn1rAPnPWk/fmmRylV5cez68I/kzFFdSnaewuL27s0+6rAzMyHhpMdbGxreAHDXTZ1B2kVaqJPypkYgM/kLLfC4EMCDPkYhdal/ixx2Ej65rIlyf+wEY1T3mjh4ZidY3w1g= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707939880; c=relaxed/simple; bh=IMeJFVvYXIGZlqOOeFKuI7o72wBhUlD09Z7zqtx9gQs=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=Kr3HU8KUjR2aBNpb6FiwiFpNQ7jPLRr8pm6Km9h2Or9YEwbx4ADzut/Ai7CbCWK5lxMLTRRRX1np0sDhsm0P2hwGax+30oGLz3YHIufxan/dauRfATMX9VgQe+H8vUsjX6Fmy0yWpqjG4nVurEp9xf9NVJz8ATsK2/t8P0apsQo= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707939878; 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: in-reply-to:in-reply-to:references:references; bh=pRotfsmmYIV/VwaVU2pDFQ/j5sY0dFqnHilWZTVGXE8=; b=ULNcZ79IinCRlSDVzrai7nCnQMiyEylbFwpzRMaJEzRjkg05VAPbO9c5cT0lTnWxWKR5My hLIEuJMdb+mnBZ1fmrbu/K8194dLGPYm1bijoaLUasx90kTi0lo3YP7Q4gzqdFYEcr7Yk/ 1qnrc9ytdnVHLN++EIWiWLGQ4EOLVCk= Received: from mail-yw1-f200.google.com (mail-yw1-f200.google.com [209.85.128.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-584-BeyWDkgrO6edviFkzKhUSQ-1; Wed, 14 Feb 2024 14:44:37 -0500 X-MC-Unique: BeyWDkgrO6edviFkzKhUSQ-1 Received: by mail-yw1-f200.google.com with SMTP id 00721157ae682-604832bcbd0so2916707b3.0 for ; Wed, 14 Feb 2024 11:44:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707939876; x=1708544676; h=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=pRotfsmmYIV/VwaVU2pDFQ/j5sY0dFqnHilWZTVGXE8=; b=LWI+aIysvCXZcURoauLf+ygyUk3k2wqJBVSVSwHuzMC0W/4fXKM7CVAQwsvQF4BZTv xAZ41oYkBj2Y6EDoGE7jk7LMr+D+4V6aD9pUCw7JZICq+rL3UZweB2dGIvENoj/W/7GO D4Qhw6g3U5241iD7BTrhRHeyXu0Ygm6HMvx9IlqrCM+dWefMeAzXjT5btnx5Xat67313 +Q3vf5qH7/02X6CaIfkIHJeTA87pDbpmipSVU5hAKEtRi+FmT3JJXrYB0EP73HPDD4Fm AjdDdHoFgqiUH+lCdBoBB/1kvnCHxmTYMnUq753D8K6RUDAQwLuTwaSUUlZ5c2GtptBj Cx6Q== X-Forwarded-Encrypted: i=1; AJvYcCV02R1YOBR9iZJiKDfDamEK6nfEymaAHq4sgcjo7i85oZ4vpoWrDjRoOzGkOUG+SBmv7OY3MjKxk+V7cfOYk4ro04tLh+zclA== X-Gm-Message-State: AOJu0YzJFEbX/yQssAnqMyu4CLWDSgsQ6Nk4Vk6HWTETISE/GwCIS7d0 iNx2S28rUXFHrzrq3tJrmq4TLU2FdjuapQkWLivRCKuMioVFQ1CZ9Wj9Ze7Xfkr58fhLgLWD14/ y1Vqs5V6zyTWxsKT+jSIvvZsRSFkolwypuu420wAYA4+l+0BVd8tLT3uoWTp79wBlul4dNNag7o DSsHWKZ18q7HCtOoTP9J7yCdPP4Y6zKQMT2PQp5G1n X-Received: by 2002:a25:8184:0:b0:dcb:ad22:1b1 with SMTP id p4-20020a258184000000b00dcbad2201b1mr3709703ybk.3.1707939876501; Wed, 14 Feb 2024 11:44:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IGx+QlJW6hXXsxLaMXTyiEc898HqWbp+rQUhzXFj6gaJ5b8lKSFsAKjXYcRz36TXayXbdFwibSFMMbHv3YfbxI= X-Received: by 2002:a25:8184:0:b0:dcb:ad22:1b1 with SMTP id p4-20020a258184000000b00dcbad2201b1mr3709692ybk.3.1707939876210; Wed, 14 Feb 2024 11:44:36 -0800 (PST) MIME-Version: 1.0 References: <4c78d538-da4d-4a54-987d-3c4257913035@gmail.com> In-Reply-To: <4c78d538-da4d-4a54-987d-3c4257913035@gmail.com> From: Jonathan Wakely Date: Wed, 14 Feb 2024 19:44:20 +0000 Message-ID: Subject: Re: [PATCH][_GLIBCXX_DEBUG] Fix std::__niter_base behavior To: =?UTF-8?Q?Fran=C3=A7ois_Dumont?= Cc: "libstdc++" , gcc-patches X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/alternative; boundary="0000000000009e996806115cbd98" X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HTML_MESSAGE,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: --0000000000009e996806115cbd98 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 14 Feb 2024 at 18:39, Fran=C3=A7ois Dumont w= rote: > libstdc++: [_GLIBCXX_DEBUG] Fix std::__niter_base behavior > > std::__niter_base is used in _GLIBCXX_DEBUG mode to remove _Safe_iterator= <> > wrapper on random access iterators. But doing so it should also preserve > original > behavior to remove __normal_iterator wrapper. > > libstdc++-v3/ChangeLog: > > * include/bits/stl_algobase.h (std::__niter_base): Redefine the > overload > definitions for __gnu_debug::_Safe_iterator. > * include/debug/safe_iterator.tcc (std::__niter_base): Adapt > declarations. > > Ok to commit once all tests completed (still need to check pre-c++11) ? > The declaration in include/bits/stl_algobase.h has a noexcept-specifier but the definition in include/debug/safe_iterator.tcc does not have one - that seems wrong (I'm surprised it even compiles). Just using std::is_nothrow_copy_constructible<_Ite> seems simpler, that will be true for __normal_iterator if is_nothrow_copy_constructible is true. The definition in include/debug/safe_iterator.tcc should use std::declval<_Ite>() not declval<_Ite>(). Is there any reason why the definition uses a late-specified-return-type (i.e. auto and ->) when the declaration doesn't? --0000000000009e996806115cbd98--