Skip to content

Commit b38c414

Browse files
committed
Ignore const casts on this pointer
1 parent 9db550f commit b38c414

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎cpp2rust/converter/converter.cpp‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1767,7 +1767,8 @@ bool Converter::VisitImplicitCastExpr(clang::ImplicitCastExpr *expr) {
17671767
case clang::CastKind::CK_NoOp: {
17681768
Convert(sub_expr);
17691769
if (expr->getType()->isPointerType() &&
1770-
sub_expr->getType()->isPointerType()) {
1770+
sub_expr->getType()->isPointerType() &&
1771+
!clang::isa<clang::CXXThisExpr>(expr->IgnoreImplicit())) {
17711772
switch (GetConstCastType(expr->getType()->getPointeeType(),
17721773
sub_expr->getType()->getPointeeType())) {
17731774
case ConstCastType::MutableToConst:

0 commit comments

Comments
 (0)