From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12527 invoked by alias); 13 Jun 2018 06:12:56 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 11294 invoked by uid 89); 13 Jun 2018 06:12:56 -0000 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 Received: from mail-wr0-f176.google.com (HELO mail-wr0-f176.google.com) (209.85.128.176) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 13 Jun 2018 06:12:54 +0000 Received: by mail-wr0-f176.google.com with SMTP id w10-v6so1343306wrk.9 for ; Tue, 12 Jun 2018 23:12:54 -0700 (PDT) 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) Received: from [172.21.192.166] ([178.15.39.162]) by smtp.gmail.com with ESMTPSA id h77-v6sm3168352wmd.9.2018.06.12.23.12.51 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Jun 2018 23:12:51 -0700 (PDT) Subject: Re: GCC 7.3.0 -std=gnu++17 failed to getline() from std::ifstream To: cygwin@cygwin.com References: <0725bdbd-0411-138a-7ea9-d6395e3256e3@t-online.de> From: Marco Atzeri Message-ID: Date: Wed, 13 Jun 2018 08:49:00 -0000 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 X-SW-Source: 2018-06/txt/msg00137.txt.bz2 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