aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2020-01-03 14:44:39 +0000
committerJonathan Wakely <redi@gcc.gnu.org>2020-01-03 14:44:39 +0000
commitb4e7013794972ddfcaf042a775b06c94d20ba96b (patch)
tree30bf0362ba8b6901f8764bce13b406f15f96fec4 /libstdc++-v3
parent48182bd670dab4d0ced7f5f2d9fce6cb589dcfbb (diff)
downloadgcc-b4e7013794972ddfcaf042a775b06c94d20ba96b.zip
gcc-b4e7013794972ddfcaf042a775b06c94d20ba96b.tar.gz
gcc-b4e7013794972ddfcaf042a775b06c94d20ba96b.tar.bz2
libstdc++: Only use std::compare_three_way when concepts are supported
Clang now supports three-way comparisons. That causes both overloads of std::lexicographical_compare_three_way to be defined, but the second one uses std::compare_three_way which depends on concepts. Clang does not yet support concepts, so the second overload should also depend on __cpp_lib_concepts. * include/bits/stl_algobase.h (lexicographical_compare_three_way): Only define four-argument overload when __cpp_lib_concepts is defined. From-SVN: r279861
Diffstat (limited to 'libstdc++-v3')
-rw-r--r--libstdc++-v3/ChangeLog5
-rw-r--r--libstdc++-v3/include/bits/stl_algobase.h2
2 files changed, 7 insertions, 0 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index bb32f6e..3b65de7 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,8 @@
+2020-01-03 Jonathan Wakely <jwakely@redhat.com>
+
+ * include/bits/stl_algobase.h (lexicographical_compare_three_way):
+ Only define four-argument overload when __cpp_lib_concepts is defined.
+
2020-01-01 John David Anglin <danglin@gcc.gnu.org>
* config/abi/post/hppa-linux-gnu/baseline_symbols.txt: Update.
diff --git a/libstdc++-v3/include/bits/stl_algobase.h b/libstdc++-v3/include/bits/stl_algobase.h
index 13de6ae..76c323a 100644
--- a/libstdc++-v3/include/bits/stl_algobase.h
+++ b/libstdc++-v3/include/bits/stl_algobase.h
@@ -1751,6 +1751,7 @@ _GLIBCXX_BEGIN_NAMESPACE_ALGO
: __first2 != __last2 ? strong_ordering::less : strong_ordering::equal;
}
+#if __cpp_lib_concepts
template<typename _InputIter1, typename _InputIter2>
constexpr auto
lexicographical_compare_three_way(_InputIter1 __first1,
@@ -1762,6 +1763,7 @@ _GLIBCXX_BEGIN_NAMESPACE_ALGO
__first2, __last2,
compare_three_way{});
}
+#endif // concepts
#endif // three_way_comparison
template<typename _InputIterator1, typename _InputIterator2,