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 43285386076C for ; Wed, 14 Feb 2024 19:44:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 43285386076C 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 43285386076C 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=1707939881; cv=none; b=Kf54x2Pe3LCfXpbXpReweHzDB2fy6A2+vR7khzMTYxOMuBQ9qXvey1Axd5KIUqqAM5sC+YZtJhj+QKuyhhDh8AR0l7dzlWNNaPePQokR1ZaB9MZUAZ2Csc/SbMa0MV7jA2vDELoE6hWs/23PmTyj8noHoQg4a4yjYWtizy8+yyg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1707939881; c=relaxed/simple; bh=IMeJFVvYXIGZlqOOeFKuI7o72wBhUlD09Z7zqtx9gQs=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=HCORYuhE3ptkiSG1WHr9O33i9rNbOU+j0Gr/KbtsMItzpGJMhEy17D5qFKindWgqawsERiX1EFkEbPUQ0mb/FGp89FaebUYs0RtmL79O8y8ake1mUxNpRC3yldXLYyrnNReuTwaFKW3OSRe5vUVpVisNIrNCeFqddi9Gyy1IxOI= 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-f197.google.com (mail-yw1-f197.google.com [209.85.128.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-583-6WaVslpXO7OOjX0lxC5olg-1; Wed, 14 Feb 2024 14:44:37 -0500 X-MC-Unique: 6WaVslpXO7OOjX0lxC5olg-1 Received: by mail-yw1-f197.google.com with SMTP id 00721157ae682-607c9677a91so1297537b3.2 for ; Wed, 14 Feb 2024 11:44:36 -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=X47ClN2GMWY9pdh8nS4RoZXbT0kR6yDpP7YFJ2iRfP8MiOCvd8/MwDneT6nUgXBq6U ezqmgA1wN3FZk2peWEUHPcaQ+hMwznyuq1Kwio5QKaehTZuhX7ts5IkAW3+ZHt29qs4o dYmgskbc8fUbn9ZmKQsLH3e8JCBgMMwSpVdNPmynBldpEC9/Qe4Z8zhRxXhv+0Hb2rRU GB/Yn9s7kcAV+5rky7+97yDhXZCnh5vuLQ8G7hGAF6BVyoInkdm4uiQktbnmPPhZUdia PDmWruyZJqy9GRn43JYXFzQxTELZG7T9iOZPzvFfcpmzyaVwSChhnMHPLgySkx1T7kM8 3jaA== X-Gm-Message-State: AOJu0Yy2u3jrygSye7e70VWX/tuqeJNamSEf5q6Nd8+totz66Ecrsbh+ Y+khNpn1r+jhotlBQoncj7n6uizXdl7t64kn8+9iDxAZKs47LUBpw0L/ZL/hCCm27AB6Sh5CB8Q +FfJhzcvoepPDuNsVhEuhIJHKEfJn8KfxoqpV8GXWqGG1Z9824tGbGuFgIkQQq+hNn0AM0FC7z5 Ry2zfwPIhnIkN+VehljA2/j1lAPqw= X-Received: by 2002:a25:8184:0:b0:dcb:ad22:1b1 with SMTP id p4-20020a258184000000b00dcbad2201b1mr3709702ybk.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=-4.0 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_H2,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--