From owner-svn-src-all@freebsd.org Wed Mar 22 07:09:32 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3DA9FD16F65; Wed, 22 Mar 2017 07:09:32 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 03D3B1CCC; Wed, 22 Mar 2017 07:09:31 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2M79Vjr066683; Wed, 22 Mar 2017 07:09:31 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2M79VS4066682; Wed, 22 Mar 2017 07:09:31 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201703220709.v2M79VS4066682@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 22 Mar 2017 07:09:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r315702 - stable/11/contrib/libc++/include X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Mar 2017 07:09:32 -0000 Author: dim Date: Wed Mar 22 07:09:30 2017 New Revision: 315702 URL: https://svnweb.freebsd.org/changeset/base/315702 Log: Pull in r283944 from upstream libc++ trunk (by Eric Fiselier): Fix std::pair on FreeBSD Summary: FreeBSD ships an old ABI for std::pair which requires that it have non-trivial copy/move constructors. Currently the non-trivial copy/move is achieved by providing explicit definitions of the constructors. This is problematic because it means the constructors don't SFINAE properly. In order to SFINAE copy/move constructors they have to be explicitly defaulted and hense non-trivial. This patch attempts to provide SFINAE'ing copy/move constructors for std::pair while still making them non-trivial. It does this by adding a base class with a non-trivial copy constructor and then allowing pair's constructors to be generated by the compiler. This also allows the constructors to be constexpr. Reviewers: emaste, theraven, rsmith, dim Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25389 This should fix building www/chromium 57.0.2987.110 on stable/11, without further hacks. Direct commit to stable/11, since head already has libc++ 4.0, which includes this fix. Reported by: cpm Modified: stable/11/contrib/libc++/include/utility Modified: stable/11/contrib/libc++/include/utility ============================================================================== --- stable/11/contrib/libc++/include/utility Wed Mar 22 07:05:27 2017 (r315701) +++ stable/11/contrib/libc++/include/utility Wed Mar 22 07:09:30 2017 (r315702) @@ -276,8 +276,20 @@ extern const piecewise_construct_t piece constexpr piecewise_construct_t piecewise_construct = piecewise_construct_t(); #endif +#if defined(_LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR) +struct __non_trivially_copyable_base { + _LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY + __non_trivially_copyable_base() _NOEXCEPT {} + _LIBCPP_CONSTEXPR_AFTER_CXX11 _LIBCPP_INLINE_VISIBILITY + __non_trivially_copyable_base(__non_trivially_copyable_base const&) _NOEXCEPT {} +}; +#endif + template struct _LIBCPP_TYPE_VIS_ONLY pair +#if defined(_LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR) +: private __non_trivially_copyable_base +#endif { typedef _T1 first_type; typedef _T2 second_type; @@ -307,26 +319,7 @@ struct _LIBCPP_TYPE_VIS_ONLY pair ) : first(__p.first), second(__p.second) {} -#if defined(_LIBCPP_DEPRECATED_ABI_DISABLE_PAIR_TRIVIAL_COPY_CTOR) - _LIBCPP_INLINE_VISIBILITY - pair(const pair& __p) - _NOEXCEPT_(is_nothrow_copy_constructible::value && - is_nothrow_copy_constructible::value) - : first(__p.first), - second(__p.second) - { - } - -# ifndef _LIBCPP_CXX03_LANG - _LIBCPP_INLINE_VISIBILITY - pair(pair&& __p) _NOEXCEPT_(is_nothrow_move_constructible::value && - is_nothrow_move_constructible::value) - : first(_VSTD::forward(__p.first)), - second(_VSTD::forward(__p.second)) - { - } -# endif -#elif !defined(_LIBCPP_CXX03_LANG) +#if !defined(_LIBCPP_CXX03_LANG) pair(pair const&) = default; pair(pair&&) = default; #else