Description
struct MoveMe {
MoveMe& operator=(this MoveMe&, const MoveMe&) = default;
constexpr MoveMe& operator=(this MoveMe& self, MoveMe&& other) {
self.value = other.value;
other.value = 0;
return self;
}
int value = 4242;
};
struct S {
S& operator=(this S&, const S&) = default;
S& operator=(this S&, S&&) = default;
MoveMe move_me;
};
constexpr bool f() {
S s1{};
S s2{};
s2 = s1;
return true;
}
static_assert(f());
clang++: /root/llvm-project/llvm/tools/clang/lib/AST/ExprConstant.cpp:6656: bool HandleFunctionCall(clang::SourceLocation, const clang::FunctionDecl*, const {anonymous}::LValue*, const clang::Expr*, llvm::ArrayRef<const clang::Expr*>, {anonymous}::CallRef, const clang::Stmt*, {anonymous}::EvalInfo&, clang::APValue&, const {anonymous}::LValue*): Assertion This && (MD->isCopyAssignmentOperator() || MD->isMoveAssignmentOperator())' failed.