Rust&C++: Fix Return value of complex expression

We were using the has_value of the previous expression of a sequence of
expression, instead of using the last expression type to know if there
is a value.

Fixes #4070
This commit is contained in:
Olivier Goffart 2023-12-08 16:35:49 +01:00
parent d45165e984
commit 63d199a728
2 changed files with 21 additions and 1 deletions

View file

@ -158,7 +158,7 @@ fn process_codeblock(
value,
stmts,
has_return_value,
has_value,
!matches!(ty, Type::Void | Type::Invalid),
);
}
}