@@ -3019,28 +3019,28 @@ bool Converter::ConvertIncAndDec(clang::UnaryOperator *expr) {
30193019 auto *sub_expr = expr->getSubExpr ();
30203020 switch (opcode) {
30213021 case clang::UO_PostInc: {
3022- PushExprKind push (*this , ExprKind::RValue );
3022+ PushExprKind push (*this , ExprKind::LValue );
30233023 Convert (sub_expr);
30243024 StrCat (" .postfix_inc()" );
30253025 SetFresh ();
30263026 return true ;
30273027 }
30283028 case clang::UO_PostDec: {
3029- PushExprKind push (*this , ExprKind::RValue );
3029+ PushExprKind push (*this , ExprKind::LValue );
30303030 Convert (sub_expr);
30313031 StrCat (" .postfix_dec()" );
30323032 SetFresh ();
30333033 return true ;
30343034 }
30353035 case clang::UO_PreInc: {
3036- PushExprKind push (*this , ExprKind::RValue );
3036+ PushExprKind push (*this , ExprKind::LValue );
30373037 Convert (sub_expr);
30383038 StrCat (" .prefix_inc()" );
30393039 SetFresh ();
30403040 return true ;
30413041 }
30423042 case clang::UO_PreDec: {
3043- PushExprKind push (*this , ExprKind::RValue );
3043+ PushExprKind push (*this , ExprKind::LValue );
30443044 Convert (sub_expr);
30453045 StrCat (" .prefix_dec()" );
30463046 SetFresh ();
@@ -3383,7 +3383,8 @@ bool Converter::VisitMemberExpr(clang::MemberExpr *expr) {
33833383 auto *base = expr->getBase ();
33843384 auto object_type = expr->isArrow () ? base->getType ()->getPointeeType ()
33853385 : base->getType ().getNonReferenceType ();
3386- if (!clang::isa<clang::CXXThisExpr>(base->IgnoreParenImpCasts ()) &&
3386+ if (!isRValue () &&
3387+ !clang::isa<clang::CXXThisExpr>(base->IgnoreParenImpCasts ()) &&
33873388 object_type.isConstQualified ()) {
33883389 if (isAddrOf ()) {
33893390 StrCat (std::format (" (&raw const {}).cast_mut()" , str));
0 commit comments