X-Recipient: archive-cygwin@delorie.com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:subject:to:references:from:message-id:date
	:mime-version:in-reply-to:content-type
	:content-transfer-encoding; q=dns; s=default; b=tc58V3ox5GX/DcrE
	RA/Jtc8ukxOtZr7Rwbs8l3cJMyhtk1yJMBjyRK6551M4exhBpsAc5IVnty8RmBrN
	UnfvLS4qcVEuQV+TMZKQxoX6AvvBdXv/vZl8JNUJOce6o5nIsh1nE8Vo+9wgTa8l
	jPzRuD1NjGXHPz3oPTvtjly67L4=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
	:list-unsubscribe:list-subscribe:list-archive:list-post
	:list-help:sender:subject:to:references:from:message-id:date
	:mime-version:in-reply-to:content-type
	:content-transfer-encoding; s=default; bh=AuUyzzAlHdyBQxRBPL+wUk
	D4z5w=; b=dWB+H4ZrikqD6bDm6qp/VIlruIy1dgZEua4LWXMUutr3grB8vMYJOM
	SfBr9BZ9uQEU79W9fdOvU5giqiNsy2q96WRfIig8ZqtHz4NJ00k8x+Ch7BKPKKVE
	+oh+vZCxHhFWp3iCxXan4kK1TwemRMdtZM39IAwFbczG2QdUe1Nrc=
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=UD:7.x, 7.x, HContent-Transfer-Encoding:8bit
X-HELO: mail-wr0-f176.google.com
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;        d=1e100.net; s=20161025;        h=x-gm-message-state:subject:to:references:from:message-id:date         :user-agent:mime-version:in-reply-to:content-language         :content-transfer-encoding;        bh=kEceBOfDHsqZAyTBRacKuUwN6O+utlkEsYb4O+BmEks=;        b=GUIUdSLEssZTct7Ccfr50UcMCWH9yf+91XaqBfEp2XAhpEmH/A/24LLT3S0X5JMhp7         o5k2z/q5GWzIq94eF0YRQjc22mCLPaSq+7w7w1H4ZMxu/IKECVdCh41/om36zEoZZu8S         +8PO8IVtt+hMufIuqJnaZb+1aG4W2iK9i3hv7NWbsGoF53rf9SNfV0eiFg1JGxE1pYT1         qfdRbJ2gHKdic9vbvnw033yhJ4yHNwtYdPuyVeHaylb4v3WaYHlw++yDwwn3JmkqdaIJ         /9wHNmwu8rygt0OOxfqsJNEna7Ec7VZ/UW97GHZBWIFn8dDoshG1iLhUQEglBRW22nkc         ZT+w==
X-Gm-Message-State: APt69E3TIVkp8ispiWUnANxavEGMW7g5cyQXYAsEMLifCyNrF4vqDano	4v2weuFSnI8BtHzFUNNohFQaRA79
X-Google-Smtp-Source: ADUXVKKMyExfp/GaY9v1RwL9mMCD14nI8sgxfLAlrCiWaTmOnRK2XzYNWFrezjkzLu9+AUbgMVNPqA==
X-Received: by 2002:adf:b60d:: with SMTP id f13-v6mr2806778wre.186.1528870372494;        Tue, 12 Jun 2018 23:12:52 -0700 (PDT)
Subject: Re: GCC 7.3.0 -std=gnu++17 failed to getline() from std::ifstream
To: cygwin@cygwin.com
References: <CAHVoUt2pHP46o6ERwx9HB5=Dn-J9xv5i-53RYtJbdev-K9DCeQ@mail.gmail.com> <0725bdbd-0411-138a-7ea9-d6395e3256e3@t-online.de>
From: Marco Atzeri <marco.atzeri@gmail.com>
Message-ID: <da63d7d5-4ccc-8171-710a-0105219888e3@gmail.com>
Date: Wed, 13 Jun 2018 08:12:47 +0200
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0
MIME-Version: 1.0
In-Reply-To: <0725bdbd-0411-138a-7ea9-d6395e3256e3@t-online.de>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
X-IsSubscribed: yes

On 6/12/2018 7:11 PM, Christian Franke wrote:
> Ivan Shynkarenka wrote:
> Could reproduce this with 32 and 64 bit Cygwin g++ 7.3.0
> 
> A comparison of preprocessor (-E) outputs shows that the "extern 
> template" declarations for getline() are only visible for C++ <= 14. 
> These are guarded by "__cplusplus <= 1402" in basic_string.tcc. This 
> should tell the compiler to generate new code for getline() if C++17 is 
> enabled instead of calling the (now incompatible) function in 
> cygstdc++-6.dll.
> 
> A comparison of assembly (-S) outputs shows that this does not work: If 
> C++17 is enabled, the compiler correctly generates local code for 
> getline(istream &, string &) but this code calls an external 
> getline(istream &, string &, char). Then the linker generates a call to 
> this getline() in cygstdc++-6.dll.
> 
> This is because there is a bogus prototype specialization for 
> getline(istream &, string &, char) in basic_string.h but no 
> corresponding implementation in basic_string.tcc. This has apparently an 
> equivalent effect as 'extern template'.
> 
> The attached patch for
>    /usr/lib/gcc/*-pc-cygwin/7.3.0/include/c++/bits/basic_string.h
> fixes this.
> 
> Christian
> 

Thanks Christian
for the investigation.

It seems an upstream bug so could you report it there ?

There are several c++17  bugs around
https://gcc.gnu.org/bugzilla/buglist.cgi?quicksearch=c%2B%2B17

that is probably the reason why gcc 7.x defaults to c++14

Regards
Marco




--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

