From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1984) id 5510039B0432; Fri, 17 Jul 2020 13:56:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5510039B0432 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1594994205; bh=u3sGb98FE/cfoV/dDKhm+sTyn3xJ4uw7ohugDUI8q1U=; h=From:To:Subject:Date:From; b=LOXewbAtM0zs3JXdmqMsrFYGzb2vP+8EcP/eyEq6I3xVAuDwRII+s0FqJucH7BAWf 0HzKzXneq4OcZFm2cgVh8LPoNzwINutZ5GYi3xXJ4H4/OH/hjfYg41ZLWL7pdx7AnS OQzQakraGA8qJtVjnqcwgAnUg+zWx4+JySagg41I= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Tamar Christina To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc(refs/vendors/ARM/heads/arm-perf-staging)] libstdc++: Fix compilation with released versions of Clang X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/vendors/ARM/heads/arm-perf-staging X-Git-Oldrev: dbde9e2d5952ff1c50c4aeaaabb23cebafb50759 X-Git-Newrev: 07522ae90b5bae2ca95b64f3a4de60bea0cc0567 Message-Id: <20200717135645.5510039B0432@sourceware.org> Date: Fri, 17 Jul 2020 13:56:45 +0000 (GMT) X-BeenThere: libstdc++-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jul 2020 13:56:45 -0000 https://gcc.gnu.org/g:07522ae90b5bae2ca95b64f3a4de60bea0cc0567 commit 07522ae90b5bae2ca95b64f3a4de60bea0cc0567 Author: Jonathan Wakely Date: Wed Mar 18 12:55:29 2020 +0000 libstdc++: Fix compilation with released versions of Clang Clang 9 supports C++20 via -std=c++2a but doesn't support Concepts, so several of the new additions related to the Ranges library fail to compile with -std=c++2a. The new definition of iterator_traits and the definition of default_sentinel_t are guarded by __cpp_lib_concepts, so check that in addition to __cplusplus > 201703L. * include/bits/stl_algobase.h (__lexicographical_compare_aux): Check __cpp_lib_concepts before using iter_reference_t. * include/bits/stream_iterator.h (istream_iterator): Check __cpp_lib_concepts before using default_sentinel_t. * include/bits/streambuf_iterator.h (istreambuf_iterator): Likewise. Diff: --- libstdc++-v3/ChangeLog | 6 ++++++ libstdc++-v3/include/bits/stl_algobase.h | 2 +- libstdc++-v3/include/bits/stream_iterator.h | 4 ++-- libstdc++-v3/include/bits/streambuf_iterator.h | 4 ++-- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index b874bb25b9e..ae5fedbc66b 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,11 @@ 2020-03-18 Jonathan Wakely + * include/bits/stl_algobase.h (__lexicographical_compare_aux): Check + __cpp_lib_concepts before using iter_reference_t. + * include/bits/stream_iterator.h (istream_iterator): Check + __cpp_lib_concepts before using default_sentinel_t. + * include/bits/streambuf_iterator.h (istreambuf_iterator): Likewise. + PR libstdc++/94203 * include/experimental/executor (executor::executor(Executor)): Call make_shared directly instead of _M_create. Create _Tgt1 object. diff --git a/libstdc++-v3/include/bits/stl_algobase.h b/libstdc++-v3/include/bits/stl_algobase.h index 8f3ca885f03..a7e92d4b473 100644 --- a/libstdc++-v3/include/bits/stl_algobase.h +++ b/libstdc++-v3/include/bits/stl_algobase.h @@ -1283,7 +1283,7 @@ _GLIBCXX_END_NAMESPACE_CONTAINER && !__gnu_cxx::__numeric_traits<_ValueType2>::__is_signed && __is_pointer<_II1>::__value && __is_pointer<_II2>::__value -#if __cplusplus > 201703L +#if __cplusplus > 201703L && __cpp_lib_concepts // For C++20 iterator_traits::value_type is non-volatile // so __is_byte could be true, but we can't use memcmp with // volatile data. diff --git a/libstdc++-v3/include/bits/stream_iterator.h b/libstdc++-v3/include/bits/stream_iterator.h index 9d8ead092b8..bd5ba2a80c0 100644 --- a/libstdc++-v3/include/bits/stream_iterator.h +++ b/libstdc++-v3/include/bits/stream_iterator.h @@ -77,7 +77,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _M_ok(__obj._M_ok) { } -#if __cplusplus > 201703L +#if __cplusplus > 201703L && __cpp_lib_concepts constexpr istream_iterator(default_sentinel_t) noexcept(is_nothrow_default_constructible_v<_Tp>) @@ -153,7 +153,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator!=(const istream_iterator& __x, const istream_iterator& __y) { return !__x._M_equal(__y); } -#if __cplusplus > 201703L +#if __cplusplus > 201703L && __cpp_lib_concepts friend bool operator==(const istream_iterator& __i, default_sentinel_t) { return !__i._M_stream; } diff --git a/libstdc++-v3/include/bits/streambuf_iterator.h b/libstdc++-v3/include/bits/streambuf_iterator.h index fc06c50040c..d3f1610fc8d 100644 --- a/libstdc++-v3/include/bits/streambuf_iterator.h +++ b/libstdc++-v3/include/bits/streambuf_iterator.h @@ -115,7 +115,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _GLIBCXX_CONSTEXPR istreambuf_iterator() _GLIBCXX_USE_NOEXCEPT : _M_sbuf(0), _M_c(traits_type::eof()) { } -#if __cplusplus > 201703L +#if __cplusplus > 201703L && __cpp_lib_concepts constexpr istreambuf_iterator(default_sentinel_t) noexcept : istreambuf_iterator() { } #endif @@ -215,7 +215,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION return traits_type::eq_int_type(__c, __eof); } -#if __cplusplus > 201703L +#if __cplusplus > 201703L && __cpp_lib_concepts friend bool operator==(const istreambuf_iterator& __i, default_sentinel_t __s) { return __i._M_at_eof(); }