Commit 1dee8996 by Jason Merrill Committed by Jason Merrill

* typeck.c (check_return_expr): Avoid redundant error.

From-SVN: r277798
parent 955cd057
2019-11-04 Jason Merrill <jason@redhat.com>
* typeck.c (check_return_expr): Avoid redundant error.
2019-11-02 Paolo Carlini <paolo.carlini@oracle.com> 2019-11-02 Paolo Carlini <paolo.carlini@oracle.com>
* typeck.c (composite_pointer_type): Add a const op_location_t& * typeck.c (composite_pointer_type): Add a const op_location_t&
......
...@@ -9729,7 +9729,7 @@ check_return_expr (tree retval, bool *no_warning) ...@@ -9729,7 +9729,7 @@ check_return_expr (tree retval, bool *no_warning)
type. In that case, we have to evaluate the expression for type. In that case, we have to evaluate the expression for
its side-effects. */ its side-effects. */
finish_expr_stmt (retval); finish_expr_stmt (retval);
else else if (retval != error_mark_node)
permerror (input_location, permerror (input_location,
"return-statement with a value, in function " "return-statement with a value, in function "
"returning %qT", valtype); "returning %qT", valtype);
......
void f(long);
void f(char);
void g()
{
return f(42); // { dg-error "ambiguous" }
} // { dg-bogus "void" "" { target *-*-* } .-1 }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment