diff --git a/libcxx/include/concepts b/libcxx/include/concepts index 88a18e96bf85c0..385ce098e1d376 100644 --- a/libcxx/include/concepts +++ b/libcxx/include/concepts @@ -243,6 +243,14 @@ template concept move_constructible = constructible_from<_Tp, _Tp> && convertible_to<_Tp, _Tp>; +// [concept.copyconstructible] +template +concept copy_constructible = + move_constructible<_Tp> && + constructible_from<_Tp, _Tp&> && convertible_to<_Tp&, _Tp> && + constructible_from<_Tp, const _Tp&> && convertible_to && + constructible_from<_Tp, const _Tp> && convertible_to; + // [concept.booleantestable] template concept __boolean_testable_impl = convertible_to<_Tp, bool>; @@ -275,14 +283,6 @@ concept equality_comparable_with = const remove_reference_t<_Up>&>> && __weakly_equality_comparable_with<_Tp, _Up>; -// [concept.copyconstructible] -template -concept copy_constructible = - move_constructible<_Tp> && - constructible_from<_Tp, _Tp&> && convertible_to<_Tp&, _Tp> && - constructible_from<_Tp, const _Tp&> && convertible_to && - constructible_from<_Tp, const _Tp> && convertible_to; - // [concept.invocable] template concept invocable = requires(_Fn&& __fn, _Args&&... __args) { diff --git a/libcxx/test/std/concepts/callable/invocable.compile.pass.cpp b/libcxx/test/std/concepts/callable/invocable.compile.pass.cpp index 9afa9d9a7126de..cd415d8d09987c 100644 --- a/libcxx/test/std/concepts/callable/invocable.compile.pass.cpp +++ b/libcxx/test/std/concepts/callable/invocable.compile.pass.cpp @@ -49,7 +49,7 @@ int main(int, char**) { NotInvocable(&A::F); { - auto X = A{}; + A X; ModelsInvocable(&A::I, X); ModelsInvocable(&A::F, X); ModelsInvocable(&A::G, X, 0); @@ -57,7 +57,7 @@ int main(int, char**) { NotInvocable(&A::G, 0); NotInvocable(&A::H); - auto const& Y = X; + A const& Y = X; ModelsInvocable(&A::I, Y); ModelsInvocable(&A::F, Y); NotInvocable(&A::G, Y, 0); diff --git a/libcxx/test/std/concepts/callable/regularinvocable.compile.pass.cpp b/libcxx/test/std/concepts/callable/regularinvocable.compile.pass.cpp index f342ca58af26fe..b085b7e5002232 100644 --- a/libcxx/test/std/concepts/callable/regularinvocable.compile.pass.cpp +++ b/libcxx/test/std/concepts/callable/regularinvocable.compile.pass.cpp @@ -48,7 +48,7 @@ int main(int, char**) { NotRegularInvocable(&A::F); { - auto X = A{}; + A X; ModelsRegularInvocable(&A::I, X); ModelsRegularInvocable(&A::F, X); ModelsRegularInvocable(&A::G, X, 0); @@ -56,7 +56,7 @@ int main(int, char**) { NotRegularInvocable(&A::G, 0); NotRegularInvocable(&A::H); - auto const& Y = X; + A const& Y = X; ModelsRegularInvocable(&A::I, Y); ModelsRegularInvocable(&A::F, Y); NotRegularInvocable(&A::G, Y, 0); diff --git a/libcxx/test/std/concepts/comparison/types.h b/libcxx/test/std/concepts/comparison/types.h index 28130532497949..6f7689e22c6137 100644 --- a/libcxx/test/std/concepts/comparison/types.h +++ b/libcxx/test/std/concepts/comparison/types.h @@ -125,14 +125,14 @@ struct cxx20_friend_eq_operator_with_deleted_ne { struct member_three_way_comparable_with_deleted_eq { auto operator<=>(member_three_way_comparable_with_deleted_eq const&) const = default; - auto + bool operator==(member_three_way_comparable_with_deleted_eq const&) const = delete; }; struct member_three_way_comparable_with_deleted_ne { auto operator<=>(member_three_way_comparable_with_deleted_ne const&) const = default; - auto + bool operator!=(member_three_way_comparable_with_deleted_ne const&) const = delete; }; @@ -140,7 +140,7 @@ struct friend_three_way_comparable_with_deleted_eq { friend auto operator<=>(friend_three_way_comparable_with_deleted_eq const&, friend_three_way_comparable_with_deleted_eq const&) = default; - friend auto + friend bool operator==(friend_three_way_comparable_with_deleted_eq const&, friend_three_way_comparable_with_deleted_eq const&) = delete; }; @@ -149,7 +149,7 @@ struct friend_three_way_comparable_with_deleted_ne { friend auto operator<=>(friend_three_way_comparable_with_deleted_ne const&, friend_three_way_comparable_with_deleted_ne const&) = default; - friend auto + friend bool operator!=(friend_three_way_comparable_with_deleted_ne const&, friend_three_way_comparable_with_deleted_ne const&) = delete; }; diff --git a/libcxx/test/std/concepts/lang/assignable.compile.pass.cpp b/libcxx/test/std/concepts/lang/assignable.compile.pass.cpp index 450c0bc56c7f6a..1278f84c10b531 100644 --- a/libcxx/test/std/concepts/lang/assignable.compile.pass.cpp +++ b/libcxx/test/std/concepts/lang/assignable.compile.pass.cpp @@ -125,7 +125,7 @@ template constexpr bool CheckAssignableFromRvalues() { NeverAssignableFrom(); - constexpr auto Result = std::assignable_from; + constexpr bool Result = std::assignable_from; static_assert(std::assignable_from == Result); return Result; @@ -135,7 +135,7 @@ template constexpr bool CheckAssignableFromLvalues() { NeverAssignableFrom(); - constexpr auto Result = std::assignable_from; + constexpr bool Result = std::assignable_from; static_assert(std::assignable_from == Result); static_assert(std::assignable_from == Result); @@ -543,8 +543,8 @@ static_assert(!CheckAssignableFromLvaluesAndRvalues< static_assert(CheckAssignableFromLvaluesAndRvalues, std::vector >()); -static_assert(!CheckAssignableFromLvaluesAndRvalues, - std::vector >()); +static_assert(!CheckAssignableFromLvaluesAndRvalues, + std::deque >()); static_assert(!CheckAssignableFromLvaluesAndRvalues< std::vector, std::vector > >()); static_assert(!CheckAssignableFromLvaluesAndRvalues, diff --git a/libcxx/test/std/concepts/lang/common.compile.pass.cpp b/libcxx/test/std/concepts/lang/common.compile.pass.cpp index 6db6b57580245d..d66d00d3708059 100644 --- a/libcxx/test/std/concepts/lang/common.compile.pass.cpp +++ b/libcxx/test/std/concepts/lang/common.compile.pass.cpp @@ -16,7 +16,7 @@ template constexpr bool CheckCommonWith() noexcept { - constexpr auto result = std::common_with; + constexpr bool result = std::common_with; static_assert(std::common_with == result); static_assert(std::common_with == result); static_assert(std::common_with == result);