Skip to content

Commit ed856e0

Browse files
committed
Drop untaken branch
1 parent 013ee33 commit ed856e0

1 file changed

Lines changed: 1 addition & 18 deletions

File tree

‎cpp2rust/converter/converter.cpp‎

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4502,24 +4502,7 @@ void Converter::ConvertVarInit(clang::QualType qual_type, clang::Expr *expr) {
45024502
StrCat(keyword_mut_);
45034503
}
45044504
}
4505-
auto *ignore_casts = expr->IgnoreCasts();
4506-
// FIXME: this looks very complicated
4507-
if (auto *ctor = clang::dyn_cast<clang::CXXConstructExpr>(ignore_casts);
4508-
ctor && ctor->getNumArgs() != 0 && IsReferenceType(ctor->getArg(0)) &&
4509-
clang::isa<clang::CallExpr>(ctor->getArg(0)->IgnoreCasts()) &&
4510-
!Mapper::Contains(
4511-
ctx_, clang::cast<clang::CallExpr>(ctor->getArg(0)->IgnoreCasts())
4512-
->getCallee()) &&
4513-
Printer::ToString(ctx_, ctor->getConstructor()->getThisType()) ==
4514-
"std::string") {
4515-
{
4516-
PushParen paren(*this);
4517-
StrCat(token::kStar);
4518-
PushInitType init_type(*this, qual_type);
4519-
Convert(expr);
4520-
}
4521-
StrCat(".clone()");
4522-
} else if (IsReferenceType(expr) || qual_type->isFunctionPointerType()) {
4505+
if (IsReferenceType(expr) || qual_type->isFunctionPointerType()) {
45234506
PushExprKind push(*this, ExprKind::AddrOf);
45244507
PushInitType init_type(*this, qual_type);
45254508
Convert(expr, qual_type);

0 commit comments

Comments
 (0)