From nobody Thu Nov 25 19:03:02 2021 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 11C3E18ADA35; Thu, 25 Nov 2021 19:03:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4J0S1y4thWz4l2v; Thu, 25 Nov 2021 19:03:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 65C2922578; Thu, 25 Nov 2021 19:03:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1APJ32to054528; Thu, 25 Nov 2021 19:03:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1APJ32BP054527; Thu, 25 Nov 2021 19:03:02 GMT (envelope-from git) Date: Thu, 25 Nov 2021 19:03:02 GMT Message-Id: <202111251903.1APJ32BP054527@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Guido Falsi Subject: git: cf108be7a7cb - main - devel/range-v3: Fix installed include to work with clang13 List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: madpilot X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: cf108be7a7cb0ab997984a70a2192af7d7040ab0 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637866982; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vqQKdezgiYQCgwGkwk773DZ7jFFdts8Wf2UY2bbcTzk=; b=dVEXLElm6t1k58gwOyiwvWemVj5FdYs4aRrSmppjWtz6JzmW6uzOHE6tzATKAdQvW90KAD d3l71lHivNotQRliWVaSJxt4iP1DbI7UccltIUNSLxKCBqHs0r4a11nRt56XrkcAH7ZL2h gRrFutn0SHdu4oEZvtqith99o8pIcYXyEffwz9s4SBJG/nHltrXoQjS4ei00fMEsIZahNK +muSNJlHAtdFN35LxYrW6DlyjMWJsilVwSHS6D87n8bLyazXwEELFo5Bkq89CoxyiqzOeC JGGXaI6zuNRb5AstQE1FgScxY8vjdhrqp/t/xIQrau+xGeQe/7yr+E1QPRwyBw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637866982; a=rsa-sha256; cv=none; b=J7jHBZVFDJ8s6FbFxdDmfdwDNr/v/hBa7uM5abwUct/VptSJ02wbdnbvkb0Ka/bu1jnUY9 wza6WozyHAdqPTMbTjnSknsuWJuc2eCKmky1HV8JRsUXw1TltFXLWr6IFDeNEMFjrVtMPW NPGChI6FktkszdLLVXRGFwTSFRETkukwaEFFGotrmlfGaKHFnsZ8f+xIffBM0oRnDMionI WecDheqlVIJy+XVXnUVF7FYPTSwxmV8W+L/CP9TICLwxiPcCKAKeIJ5ZzDAJLEWb9Cb0tR 2n68cDv2NiMRm6EtP5/X8U5T/64FFhDGy+LeVPa1nGlUv20FXqmT4o2w94kxdg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by madpilot: URL: https://cgit.FreeBSD.org/ports/commit/?id=cf108be7a7cb0ab997984a70a2192af7d7040ab0 commit cf108be7a7cb0ab997984a70a2192af7d7040ab0 Author: Guido Falsi AuthorDate: 2021-11-25 18:59:53 +0000 Commit: Guido Falsi CommitDate: 2021-11-25 18:59:53 +0000 devel/range-v3: Fix installed include to work with clang13 Import upstream patch to fix incompatibility with clang13. This fixes build of telegram-desktop [1] in recent head after clang13 import. PR: 260044, 260040 [1] Approved by: build fix blanket Obtained from: https://github.com/ericniebler/range-v3/commit/0487cca29e352e8f16bbd91fda38e76e39a0ed28 --- devel/range-v3/Makefile | 1 + devel/range-v3/files/patch-0487cca29e35 | 122 ++++++++++++++++++++++++++++++++ 2 files changed, 123 insertions(+) diff --git a/devel/range-v3/Makefile b/devel/range-v3/Makefile index 6c2b421dece4..3c73c473ae9f 100644 --- a/devel/range-v3/Makefile +++ b/devel/range-v3/Makefile @@ -1,5 +1,6 @@ PORTNAME= range-v3 DISTVERSION= 0.11.0 +PORTREVISION= 1 CATEGORIES= devel MAINTAINER= henry.hu.sh@gmail.com diff --git a/devel/range-v3/files/patch-0487cca29e35 b/devel/range-v3/files/patch-0487cca29e35 new file mode 100644 index 000000000000..90a378edb768 --- /dev/null +++ b/devel/range-v3/files/patch-0487cca29e35 @@ -0,0 +1,122 @@ +From 0487cca29e352e8f16bbd91fda38e76e39a0ed28 Mon Sep 17 00:00:00 2001 +From: Louis Dionne +Date: Tue, 15 Jun 2021 14:40:01 -0400 +Subject: [PATCH] Work around broken integration with latest libc++. (#1635) + +* Work around broken integration with latest libc++. + +In newer versions of libc++, the base template of std::iterator_traits +provides a member typedef called __primary_template which is an alias +to the std::iterator_traits specialization itself. This fix works with +both the old version of libc++ and the new one. + +Fixes issue #1633. + +* Fix is_std_iterator_traits_specialized_v on MSVC + +It used to pretend that std::iterator_traits is a user-defined +specialization, which isn't the case. This is due to MSVC's +iterator_traits specialization not posing as the base template. +--- + include/std/detail/associated_types.hpp | 22 +++++++++++----- + test/CMakeLists.txt | 1 + + test/bug1633.cpp | 34 +++++++++++++++++++++++++ + 3 files changed, 51 insertions(+), 6 deletions(-) + create mode 100644 test/bug1633.cpp + +diff --git a/include/std/detail/associated_types.hpp b/include/std/detail/associated_types.hpp +index b642166d4..449a3f91c 100644 +--- include/std/detail/associated_types.hpp ++++ include/std/detail/associated_types.hpp +@@ -265,11 +265,22 @@ namespace ranges + template + char is_std_iterator_traits_specialized_impl_(void *); + #elif defined(_LIBCPP_VERSION) +- template +- char ( +- &is_std_iterator_traits_specialized_impl_(std::__iterator_traits *))[2]; ++ // In older versions of libc++, the base template inherits from std::__iterator_traits. ++ template class IteratorTraitsBase, typename I, bool B> ++ char (&libcpp_iterator_traits_base_impl(IteratorTraitsBase *))[2]; ++ template class IteratorTraitsBase, typename I> ++ char libcpp_iterator_traits_base_impl(void *); ++ ++ // In newer versions, the base template has only one template parameter and provides the ++ // __primary_template typedef which aliases the iterator_traits specialization. ++ template class, typename I> ++ char (&libcpp_iterator_traits_base_impl(typename std::iterator_traits::__primary_template *))[2]; ++ template class, typename I> ++ char libcpp_iterator_traits_base_impl(void *); ++ + template +- char is_std_iterator_traits_specialized_impl_(void *); ++ auto is_std_iterator_traits_specialized_impl_(std::iterator_traits* traits) ++ -> decltype(libcpp_iterator_traits_base_impl(traits)); + #elif defined(_MSVC_STL_VERSION) + template + char (&is_std_iterator_traits_specialized_impl_( +@@ -287,14 +298,13 @@ namespace ranges + RANGES_INLINE_VAR constexpr bool is_std_iterator_traits_specialized_v = + 1 == sizeof(is_std_iterator_traits_specialized_impl_( + static_cast *>(nullptr))); +- ++#endif + // The standard iterator_traits specialization(s) do not count + // as user-specialized. This will no longer be necessary in C++20. + // This helps with `T volatile*` and `void *`. + template + RANGES_INLINE_VAR constexpr bool is_std_iterator_traits_specialized_v = + false; +-#endif + } // namespace detail + /// \endcond + } // namespace ranges +diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt +index 889f314af..2c2b7c09c 100644 +--- test/CMakeLists.txt ++++ test/CMakeLists.txt +@@ -19,3 +19,4 @@ rv3_add_test(test.bug474 bug474 bug474.cpp) + rv3_add_test(test.bug566 bug566 bug566.cpp) + rv3_add_test(test.bug1322 bug1322 bug1322.cpp) + rv3_add_test(test.bug1335 bug1335 bug1335.cpp) ++rv3_add_test(test.bug1633 bug1633 bug1633.cpp) +diff --git a/test/bug1633.cpp b/test/bug1633.cpp +new file mode 100644 +index 000000000..be52420ad +--- /dev/null ++++ test/bug1633.cpp +@@ -0,0 +1,34 @@ ++// Range v3 library ++// ++// Use, modification and distribution is subject to the ++// Boost Software License, Version 1.0. (See accompanying ++// file LICENSE_1_0.txt or copy at ++// http://www.boost.org/LICENSE_1_0.txt) ++// ++// Project home: https://github.com/ericniebler/range-v3 ++ ++#include ++#include ++#include ++ ++struct X { }; ++ ++namespace std { ++ template<> struct iterator_traits { }; ++} ++ ++struct Y { ++ using difference_type = std::ptrdiff_t; ++ using value_type = int; ++ using pointer = int*; ++ using reference = int&; ++ using iterator_category = std::forward_iterator_tag; ++}; ++ ++static_assert(ranges::detail::is_std_iterator_traits_specialized_v, ""); ++static_assert(!ranges::detail::is_std_iterator_traits_specialized_v, ""); ++static_assert(!ranges::detail::is_std_iterator_traits_specialized_v, ""); ++ ++int main() ++{ ++}