From patchwork Mon Jan 9 11:04:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 90387 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp24546qgi; Mon, 9 Jan 2017 03:05:26 -0800 (PST) X-Received: by 10.98.215.13 with SMTP id b13mr73453573pfh.31.1483959925923; Mon, 09 Jan 2017 03:05:25 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id s1si1909074plj.237.2017.01.09.03.05.25 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Jan 2017 03:05:25 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-return-445666-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org; spf=pass (google.com: domain of gcc-patches-return-445666-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-445666-patch=linaro.org@gcc.gnu.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; q=dns; s=default; b=dWA2lX2Po7VyedtcG PlmT7XUNq7IepYagQQ4DW4AIX0yIyzNEm6aGMj+JlMeb8zXrEdYCwVX+1R/do6Xu M6EU2ZXvMZ0XbNJ00RhvYPT2bDa54FQLvIC2b67WlIaFYQIXrDShNMxF/8/B/EkC f/5SMFKBP14u30GaBu9iVgGGzI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=default; bh=BlN2aO2XjwReXfK8MFBq5yB UOF4=; b=npaKXGfZgTs/D9ll62m2LAiabgP0a2tNe3+GuQR90zisqwZX5uPbGnz ZHp6/n9vk1jzmn8yNiaRKgpxf4vDDK9oi8iA9jPfaiXfmftOiN9glVPEjikp5srY Mw3luAeRULdADHkcUADDQDF+v5HkrZdrDt0cSaXfLSE6ctdp8jQM= Received: (qmail 23340 invoked by alias); 9 Jan 2017 11:05:11 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 23319 invoked by uid 89); 9 Jan 2017 11:05:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-5.1 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= 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, 09 Jan 2017 11:05:00 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 59F58C051663; Mon, 9 Jan 2017 11:05:00 +0000 (UTC) Received: from localhost (ovpn-116-26.ams2.redhat.com [10.36.116.26]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v09B4wqG004130; Mon, 9 Jan 2017 06:04:59 -0500 Date: Mon, 9 Jan 2017 11:04:57 +0000 From: Jonathan Wakely To: Kyrill Tkachov Cc: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: Re: [PATCH] PR78991 make __gnu_cxx::__ops constructors explicit Message-ID: <20170109110457.GE13348@redhat.com> References: <20170106124017.GA7408@redhat.com> <58736866.3090209@foss.arm.com> <20170109104746.GA15819@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20170109104746.GA15819@redhat.com> X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.7.1 (2016-10-04) On 09/01/17 10:47 +0000, Jonathan Wakely wrote: >On 09/01/17 10:39 +0000, Kyrill Tkachov wrote: >>Hi Jonathan, >> >>On 06/01/17 12:40, Jonathan Wakely wrote: >>>This solves a problem when using libstdc++ with Clang, due to Clang >>>more eagerly instantiating constexpr function templates during >>>argument deduction. G++ has some shortcuts to avoid this problem, but >>>Clang doesn't, and it's not clear that it's strictly speaking a bug in >>>Clang or if it's following the standard. By making these constructors >>>explicit we stop them being considered by overload resolution for >>>copying these functors, which stops us ending up back in the >>>std::function SFINAE checks. >>> >>>I'm also using _GLIBCXX_MOVE to turn some internal copies into moves, >>>because otherwise using something like std::function with >>>results in a number of potentially expensive copies. >>> >>> PR libstdc++/78991 >>> * include/bits/predefined_ops.h (_Iter_comp_iter, _Iter_comp_val) >>> (_Val_comp_iter, _Iter_equals_val, _Iter_pred, _Iter_comp_to_val) >>> (_Iter_comp_to_iter, _Iter_negate): Make constructors explicit and >>> move function objects. >>> (__iter_comp_iter, __iter_comp_val, __val_comp_iter, __pred_iter) >>> (__iter_comp_val, __iter_comp_iter, __negate): Move function objects. >>> * testsuite/25_algorithms/sort/78991.cc: New test. >>> >>>Tested powerpc64le-linux, committed to trunk. >>> >>>I'll backport the 'explicit' constructors (but not the _GLIBCXX_MOVE >>>changes) to the branches too. >>> >> >>I see this test fail on the GCC 5 branch on arm and aarch64 (error message pasted below). >>Does the test need a gnu++11 guard or something on the branch? > >I thought I'd changed that before committing, I'll fix it. Committed to gcc-5-branch. commit 366c9e60ffa0536ab87de4e70ec807c2eb5fb66b Author: Jonathan Wakely Date: Mon Jan 9 10:54:44 2017 +0000 Add missing dg-options to C++14 test * testsuite/25_algorithms/sort/78991.cc: Compile with -std=gnu++14. diff --git a/libstdc++-v3/testsuite/25_algorithms/sort/78991.cc b/libstdc++-v3/testsuite/25_algorithms/sort/78991.cc index d947538..260878e 100644 --- a/libstdc++-v3/testsuite/25_algorithms/sort/78991.cc +++ b/libstdc++-v3/testsuite/25_algorithms/sort/78991.cc @@ -15,6 +15,7 @@ // with this library; see the file COPYING3. If not see // . +// { dg-options "-std=gnu++14" } // { dg-do compile } // PR 78991