[libcxx-commits] [libcxx] b2a0cc1 - [libc++] Guard bits of 598983d7 against _LIBCPP_HAS_NO_CONCEPTS.
Arthur O'Dwyer via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Feb 2 08:20:32 PST 2022
Author: Arthur O'Dwyer
Date: 2022-02-02T11:19:46-05:00
New Revision: b2a0cc1c65e26c58ab6e21fdf2257e9f89536d08
URL: https://github.com/llvm/llvm-project/commit/b2a0cc1c65e26c58ab6e21fdf2257e9f89536d08
DIFF: https://github.com/llvm/llvm-project/commit/b2a0cc1c65e26c58ab6e21fdf2257e9f89536d08.diff
LOG: [libc++] Guard bits of 598983d7 against _LIBCPP_HAS_NO_CONCEPTS.
Added:
Modified:
libcxx/include/__utility/pair.h
libcxx/include/tuple
libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/common_reference.compile.pass.cpp
libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/common_type.pass.cpp
Removed:
################################################################################
diff --git a/libcxx/include/__utility/pair.h b/libcxx/include/__utility/pair.h
index bc21545ca5a2..602e653aecab 100644
--- a/libcxx/include/__utility/pair.h
+++ b/libcxx/include/__utility/pair.h
@@ -389,7 +389,7 @@ operator<=(const pair<_T1,_T2>& __x, const pair<_T1,_T2>& __y)
#endif // !defined(_LIBCPP_HAS_NO_CONCEPTS)
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER > 20 && !defined(_LIBCPP_HAS_NO_CONCEPTS)
template <class _T1, class _T2, class _U1, class _U2, template<class> class _TQual, template<class> class _UQual>
requires requires { typename pair<common_reference_t<_TQual<_T1>, _UQual<_U1>>,
common_reference_t<_TQual<_T2>, _UQual<_U2>>>; }
@@ -403,7 +403,7 @@ template <class _T1, class _T2, class _U1, class _U2>
struct common_type<pair<_T1, _T2>, pair<_U1, _U2>> {
using type = pair<common_type_t<_T1, _U1>, common_type_t<_T2, _U2>>;
};
-#endif
+#endif // _LIBCPP_STD_VER > 20 && !defined(_LIBCPP_HAS_NO_CONCEPTS)
template <class _T1, class _T2>
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
diff --git a/libcxx/include/tuple b/libcxx/include/tuple
index 6f3368ca301f..b5989dd7b040 100644
--- a/libcxx/include/tuple
+++ b/libcxx/include/tuple
@@ -1116,7 +1116,7 @@ public:
void swap(tuple&) _NOEXCEPT {}
};
-#if _LIBCPP_STD_VER > 20
+#if _LIBCPP_STD_VER > 20 && !defined(_LIBCPP_HAS_NO_CONCEPTS)
template <class... _TTypes, class... _UTypes, template<class> class _TQual, template<class> class _UQual>
requires requires { typename tuple<common_reference_t<_TQual<_TTypes>, _UQual<_UTypes>>...>; }
struct basic_common_reference<tuple<_TTypes...>, tuple<_UTypes...>, _TQual, _UQual> {
@@ -1128,7 +1128,7 @@ template <class... _TTypes, class... _UTypes>
struct common_type<tuple<_TTypes...>, tuple<_UTypes...>> {
using type = tuple<common_type_t<_TTypes, _UTypes>...>;
};
-#endif
+#endif // _LIBCPP_STD_VER > 20 && !defined(_LIBCPP_HAS_NO_CONCEPTS)
#if _LIBCPP_STD_VER > 14
template <class ..._Tp>
diff --git a/libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/common_reference.compile.pass.cpp b/libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/common_reference.compile.pass.cpp
index 135f933ebbcb..899eb8397bfc 100644
--- a/libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/common_reference.compile.pass.cpp
+++ b/libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/common_reference.compile.pass.cpp
@@ -196,7 +196,7 @@ struct std::basic_common_reference<A, std::tuple<B>, TQual, UQual> {
using type = tuple<UQual<B>>;
};
-static_assert(std::is_same_v<std::common_reference_t<A, std::tuple<B>,std::tuple<D>>, std::tuple<B>>);
+static_assert(std::is_same_v<std::common_reference_t<A, std::tuple<B>, std::tuple<D>>, std::tuple<B>>);
static_assert(std::is_same_v<std::common_reference_t<std::pair<int, int>>,
diff --git a/libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/common_type.pass.cpp b/libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/common_type.pass.cpp
index 2842d9835d40..66a29a37a368 100644
--- a/libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/common_type.pass.cpp
+++ b/libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/common_type.pass.cpp
@@ -360,7 +360,7 @@ int main(int, char**)
static_assert(std::is_same_v<std::common_type_t<std::tuple<const int&>>, std::tuple<int>>);
static_assert(std::is_same_v<std::common_type_t<std::tuple<const volatile int&>, std::tuple<const volatile long&>>, std::tuple<long>>);
- static_assert(std::is_same_v<std::common_type_t<A, std::tuple<B>,std::tuple<C>>, std::tuple<B>>);
+ static_assert(std::is_same_v<std::common_type_t<A, std::tuple<B>, std::tuple<C>>, std::tuple<B>>);
static_assert(std::is_same_v<std::common_type_t<std::pair<int, int>>, std::pair<int, int>>);
static_assert(std::is_same_v<std::common_type_t<std::pair<int, long>, std::pair<long, int>>, std::pair<long, long>>);
@@ -373,7 +373,7 @@ int main(int, char**)
std::pair<const volatile long&, const volatile int&>>,
std::pair<long, long>>);
- static_assert(std::is_same_v<std::common_type_t<A, std::tuple<B>,std::tuple<C>>, std::tuple<B>>);
+ static_assert(std::is_same_v<std::common_type_t<A, std::tuple<B>, std::tuple<C>>, std::tuple<B>>);
#endif
return 0;
More information about the libcxx-commits
mailing list