libstdc++: Fix compilation with released versions of Clang
authorJonathan Wakely <jwakely@redhat.com>
Wed, 18 Mar 2020 12:55:29 +0000 (12:55 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Wed, 18 Mar 2020 12:55:29 +0000 (12:55 +0000)
commit07522ae90b5bae2ca95b64f3a4de60bea0cc0567
tree95a4d7b13262a92a762c606e5f8f117f422d4c26
parentdbde9e2d5952ff1c50c4aeaaabb23cebafb50759
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.
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/stl_algobase.h
libstdc++-v3/include/bits/stream_iterator.h
libstdc++-v3/include/bits/streambuf_iterator.h