Skip to content

Commit a35ace0

Browse files
committed
Fix move_from for lambdas
1 parent de6c784 commit a35ace0

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

‎cpp2rust/converter/models/converter_refcount.cpp‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2309,19 +2309,19 @@ bool ConverterRefCount::VisitCXXConstructExpr(clang::CXXConstructExpr *expr) {
23092309
}
23102310

23112311
auto *ctor = expr->getConstructor();
2312-
if (IsRValueConvertingConstructor(ctor) ||
2313-
(ctor->isMoveConstructor() && !IsUserDefinedDecl(ctor->getParent()))) {
2314-
StrCat(ConvertLValue(expr->getArg(0)));
2315-
return false;
2316-
}
2317-
23182312
if (IsLambdaCopyOrMoveConstructor(ctor)) {
23192313
StrCat(ConvertRValue(expr->getArg(0)),
23202314
std::format(".{}()", GetCopyOrMoveName(ctor)));
23212315
SetFreshType(expr->getType());
23222316
return false;
23232317
}
23242318

2319+
if (IsRValueConvertingConstructor(ctor) ||
2320+
(ctor->isMoveConstructor() && !IsUserDefinedDecl(ctor->getParent()))) {
2321+
StrCat(ConvertLValue(expr->getArg(0)));
2322+
return false;
2323+
}
2324+
23252325
if (ctor->isCopyOrMoveConstructor() &&
23262326
!IsConvertibleCopyOrMoveConstructor(ctor)) {
23272327
StrCat(PushSuppressIteratorClone::take(*this)

0 commit comments

Comments
 (0)