Skip to content

Commit 016676d

Browse files
committed
Ignore const casts on this pointer
1 parent 2dbc338 commit 016676d

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
@@ -1763,7 +1763,8 @@ bool Converter::VisitImplicitCastExpr(clang::ImplicitCastExpr *expr) {
17631763
case clang::CastKind::CK_NoOp: {
17641764
Convert(sub_expr);
17651765
if (expr->getType()->isPointerType() &&
1766-
sub_expr->getType()->isPointerType()) {
1766+
sub_expr->getType()->isPointerType() &&
1767+
!clang::isa<clang::CXXThisExpr>(expr->IgnoreImplicit())) {
17671768
switch (GetConstCastType(expr->getType()->getPointeeType(),
17681769
sub_expr->getType()->getPointeeType())) {
17691770
case ConstCastType::MutableToConst:

0 commit comments

Comments
 (0)