File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3159,6 +3159,7 @@ bool Converter::VisitStmtExpr(clang::StmtExpr *expr) {
31593159 Convert (s);
31603160 }
31613161 }
3162+ SetFreshType (expr->getType ());
31623163 return false ;
31633164}
31643165
Original file line number Diff line number Diff line change @@ -1770,9 +1770,7 @@ bool ConverterRefCount::VisitReturnStmt(clang::ReturnStmt *stmt) {
17701770
17711771bool ConverterRefCount::VisitStmtExpr (clang::StmtExpr *expr) {
17721772 PushConversionKind push (*this , ConversionKind::FullRefCount);
1773- Converter::VisitStmtExpr (expr);
1774- SetFreshType (expr->getType ());
1775- return false ;
1773+ return Converter::VisitStmtExpr (expr);
17761774}
17771775
17781776void ConverterRefCount::ConvertBinaryOperator (clang::BinaryOperator *expr) {
Original file line number Diff line number Diff line change @@ -41,6 +41,15 @@ fn main_0() -> i32 {
4141 inner
4242 } == 100 )
4343 ) ;
44+ {
45+ counter. postfix_inc ( )
46+ } ;
47+ {
48+ if ( counter != 2 ) {
49+ counter = 2 ;
50+ }
51+ } ;
52+ assert ! ( ( counter == 2 ) ) ;
4453 return 0 ;
4554}
4655pub fn __cpp2rust_init_globals ( ) { }
Original file line number Diff line number Diff line change @@ -43,6 +43,15 @@ unsafe fn main_0() -> i32 {
4343 inner
4444 } ) == ( 100 ) )
4545 ) ;
46+ {
47+ counter. postfix_inc ( )
48+ } ;
49+ {
50+ if ( ( counter) != ( 2 ) ) {
51+ counter = 2 ;
52+ }
53+ } ;
54+ assert ! ( ( ( counter) == ( 2 ) ) ) ;
4655 return 0 ;
4756}
4857pub unsafe fn __cpp2rust_init_globals ( ) { }
Original file line number Diff line number Diff line change @@ -32,5 +32,13 @@ int main() {
3232 });
3333 inner;
3434 }) == 100 );
35+
36+ ({ counter++; });
37+ __extension__ ({
38+ if (counter != 2 ) {
39+ counter = 2 ;
40+ }
41+ });
42+ assert (counter == 2 );
3543 return 0 ;
3644}
You can’t perform that action at this time.
0 commit comments