From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 64622 invoked by alias); 25 Sep 2017 13:46:05 -0000 Mailing-List: contact libstdc++-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libstdc++-owner@gcc.gnu.org Received: (qmail 64599 invoked by uid 89); 25 Sep 2017 13:46:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1690, observable, life, reserved X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 25 Sep 2017 13:46:03 +0000 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 04D89C0587DE; Mon, 25 Sep 2017 13:46:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 04D89C0587DE Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=jwakely@redhat.com Received: from localhost (unknown [10.33.36.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id AC14B6C42C; Mon, 25 Sep 2017 13:46:01 +0000 (UTC) Date: Mon, 25 Sep 2017 13:46:00 -0000 From: Jonathan Wakely To: Petr Ovtchenkov Cc: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org, =?iso-8859-1?Q?Fran=E7ois?= Dumont Subject: Re: [PATCH] libstdc++: istreambuf_iterator keep attached streambuf Message-ID: <20170925134600.GY4582@redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.8.3 (2017-05-23) X-IsSubscribed: yes X-SW-Source: 2017-09/txt/msg00092.txt.bz2 On 23/09/17 09:54 +0300, Petr Ovtchenkov wrote: >istreambuf_iterator should not forget about attached >streambuf when it reach EOF. > >Checks in debug mode has no infuence more on character >extraction in istreambuf_iterator increment operators. >In this aspect behaviour in debug and non-debug mode >is similar now. > >Test for detached srteambuf in istreambuf_iterator: >When istreambuf_iterator reach EOF of istream, it should not >forget about attached streambuf. >From fact "EOF in stream reached" not follow that >stream reach end of life and input operation impossible >more. >--- > libstdc++-v3/include/bits/streambuf_iterator.h | 41 +++++++-------- > .../24_iterators/istreambuf_iterator/3.cc | 61 ++++++++++++++++++++++ > 2 files changed, 80 insertions(+), 22 deletions(-) > create mode 100644 libstdc++-v3/testsuite/24_iterators/istreambuf_iterator/3.cc > >diff --git a/libstdc++-v3/include/bits/streambuf_iterator.h b/libstdc++-v3/include/bits/streambuf_iterator.h >index f0451b1..45c3d89 100644 >--- a/libstdc++-v3/include/bits/streambuf_iterator.h >+++ b/libstdc++-v3/include/bits/streambuf_iterator.h >@@ -136,12 +136,20 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION > istreambuf_iterator& > operator++() > { >- __glibcxx_requires_cond(!_M_at_eof(), >+ __glibcxx_requires_cond(_M_sbuf, > _M_message(__gnu_debug::__msg_inc_istreambuf) > ._M_iterator(*this)); > if (_M_sbuf) > { >+#ifdef _GLIBCXX_DEBUG_PEDANTIC >+ int_type _tmp = _tmp is not a reserved name, this needs to be __tmp. I'm still reviewing the rest, to understand what observable behaviour this changes, and how it differs from the patch François sent.