Bug 1885840 - Clarify comment in TestMaybe on why move operations unexpectedly work with a non-movable type. r=glandium

As Bug 1601251 states, those operations need to be explicitly deleted for the
asserts to hold.

Differential Revision: https://phabricator.services.mozilla.com/D204990
This commit is contained in:
Andreas Pehrson 2024-03-22 08:17:04 +00:00
parent fbe4b71f35
commit 3a4d791e34

View File

@ -530,7 +530,8 @@ static bool TestCopyAndMove() {
static_assert(std::is_copy_constructible_v<Maybe<UnmovableValue>>); static_assert(std::is_copy_constructible_v<Maybe<UnmovableValue>>);
static_assert(std::is_copy_assignable_v<Maybe<UnmovableValue>>); static_assert(std::is_copy_assignable_v<Maybe<UnmovableValue>>);
// XXX Why do these static_asserts not hold? // TODO(Bug 1601251): Maybe<T> should delete move operations if T does not
// support moves
// static_assert(!std::is_move_constructible_v<Maybe<UnmovableValue>>); // static_assert(!std::is_move_constructible_v<Maybe<UnmovableValue>>);
// static_assert(!std::is_move_assignable_v<Maybe<UnmovableValue>>); // static_assert(!std::is_move_assignable_v<Maybe<UnmovableValue>>);
} }