On 10/17/24 10:30 AM, Simon Martin wrote:
Hi,
The issue reported in PR117129 is pretty similar to the one in PR117099,
so here’s an updated version of the patch that fixes both issues, by
ensuring that finish_return_expr sets current_function_return_value to
error_mark_node in case of error with said return value.
permerror (input_location, "return-statement with no value, in "
"function returning %qT", valtype);
- /* Remember that this function did return. */
+ /* Remember that this function returns an error. */
current_function_returns_value = 1;
+ retval = error_mark_node;
We shouldn't do this if -fpermissive made the permerror into a warning;
let's just set current_function_return_value.
Jason