Index: test/std/utilities/tuple/tuple.tuple/tuple.assign/sfinae_tuple_assignment.fail.cpp =================================================================== --- /dev/null +++ test/std/utilities/tuple/tuple.tuple/tuple.assign/sfinae_tuple_assignment.fail.cpp @@ -0,0 +1,92 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03 + +// + +// tuple assignment operators + +#include +#include + +struct NoCopyAssign +{ + NoCopyAssign() = default; + NoCopyAssign& operator=(NoCopyAssign const&) = delete; +}; + +struct Foo {}; + +struct NoMoveAssign +{ + NoMoveAssign() = default; + NoMoveAssign& operator=(NoMoveAssign&&) = delete; +}; + +struct OtherNoMoveAssign +{ + OtherNoMoveAssign() = default; + OtherNoMoveAssign& operator=(OtherNoMoveAssign&&) = delete; +}; + +int main() +{ + { + typedef std::tuple tuple_t; + static_assert(!std::is_copy_assignable::value, ""); + + tuple_t a; + tuple_t b; + b = a; // expected-error {{object of type 'std::__1::tuple' cannot be assigned because its copy assignment operator is implicitly deleted}} + } + { + typedef std::tuple tuple_t; + static_assert(!std::is_move_assignable::value, ""); + + tuple_t a; + tuple_t b; + b = std::move(a); // expected-error {{object of type 'std::__1::tuple' cannot be assigned because its copy assignment operator is implicitly deleted}} + } + { + typedef std::tuple tuple_a; + typedef std::tuple tuple_b; + static_assert(!std::is_assignable::value, ""); + + tuple_a a; + tuple_b b; + b = a; // expected-error {{no viable overloaded '='}} + } + { + typedef std::tuple tuple_a; + typedef std::tuple tuple_b; + static_assert(!std::is_assignable::value, ""); + + tuple_a a; + tuple_b b; + b = std::move(a); // expected-error {{no viable overloaded '='}} + } + { + typedef std::tuple tuple_t; + typedef std::pair pair_t; + static_assert(!std::is_assignable::value, ""); + + tuple_t a; + pair_t b; + b = a; // expected-error {{no viable overloaded '='}} + } + { + typedef std::tuple tuple_t; + typedef std::pair pair_t; + static_assert(!std::is_assignable::value, ""); + + tuple_t a; + pair_t b; + b = std::move(a); // expected-error {{no viable overloaded '='}} + } +} Index: test/std/utilities/utility/pairs/pairs.pair/sfinae_pair_assignment.fail.cpp =================================================================== --- /dev/null +++ test/std/utilities/utility/pairs/pairs.pair/sfinae_pair_assignment.fail.cpp @@ -0,0 +1,93 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03 + +// + +// pair assignment operators + +#include + +struct NoCopyAssign +{ + NoCopyAssign() = default; + NoCopyAssign& operator=(NoCopyAssign const&) = delete; +}; + +struct Foo {}; + +struct NoMoveAssign +{ + NoMoveAssign() = default; + NoMoveAssign& operator=(NoMoveAssign&&) = delete; +}; + +struct OtherNoMoveAssign +{ + OtherNoMoveAssign() = default; + OtherNoMoveAssign& operator=(OtherNoMoveAssign&&) = delete; +}; + +int main() +{ + { + typedef std::pair pair_t; + static_assert(!std::is_copy_assignable::value, ""); + static_assert(!std::is_copy_assignable::value, ""); + + pair_t a; + pair_t b; + b = a; // expected-error {{object of type 'std::__1::pair' cannot be assigned because its copy assignment operator is implicitly deleted}} + } + { + typedef std::pair pair_t; + static_assert(!std::is_copy_assignable::value, ""); + + pair_t a; + pair_t b; + b = a; // expected-error {{object of type 'std::__1::pair' cannot be assigned because its copy assignment operator is implicitly deleted}} + } + { + typedef std::pair pair_t; + static_assert(!std::is_copy_assignable::value, ""); + + pair_t a; + pair_t b; + b = a; // expected-error {{object of type 'std::__1::pair' cannot be assigned because its copy assignment operator is implicitly deleted}} + } + { + typedef std::pair pair_t; + typedef std::pair pair_i; + static_assert(!std::is_assignable::value, ""); + static_assert(!std::is_assignable::value, ""); + + pair_t a; + pair_i b; + b = a; // expected-error {{no viable overloaded '='}} + } + { + typedef std::pair pair_t; + static_assert(!std::is_move_assignable::value, ""); + static_assert(!std::is_move_assignable::value, ""); + + pair_t a; + pair_t b; + b = std::move(a); // expected-error {{object of type 'std::__1::pair' cannot be assigned because its copy assignment operator is implicitly deleted}} + } + { + typedef std::pair pair_t; + typedef std::pair pair_o; + static_assert(!std::is_assignable::value, ""); + static_assert(!std::is_assignable::value, ""); + + pair_t a; + pair_o b; + b = std::move(a); // expected-error {{no viable overloaded '='}} + } +} Index: www/cxx1z_status.html =================================================================== --- www/cxx1z_status.html +++ www/cxx1z_status.html @@ -412,7 +412,7 @@ 2699Missing restriction in [numeric.requirements]IssaquahComplete 2712copy_file(from, to, ...) has a number of unspecified error conditionsIssaquahComplete 2722equivalent incorrectly specifies throws clauseIssaquahComplete - 2729Missing SFINAE on std::pair::operator=Issaquah + 2729Missing SFINAE on std::pair::operator=IssaquahComplete 2732Questionable specification of path::operator/= and path::appendIssaquahComplete 2733[fund.ts.v2] gcd / lcm and boolIssaquahComplete 2735std::abs(short), std::abs(signed char) and others should return int instead of double in order to be compatible with C++98 and CIssaquah