* semantics.c (finish_return_stmt): Suppress -Wreturn-type on
erroneous return statement.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@220252
138bc75d-0d04-0410-961f-
82ee72b054a4
2015-01-29 Jason Merrill <jason@redhat.com>
+ PR c++/49508
+ * semantics.c (finish_return_stmt): Suppress -Wreturn-type on
+ erroneous return statement.
+
PR c++/64521
* repo.c (repo_emit_p): It's OK for a clone to be extern at this
point.
if (error_operand_p (expr)
|| (flag_openmp && !check_omp_return ()))
- return error_mark_node;
+ {
+ /* Suppress -Wreturn-type for this function. */
+ if (warn_return_type)
+ TREE_NO_WARNING (current_function_decl) = true;
+ return error_mark_node;
+ }
+
if (!processing_template_decl)
{
if (warn_sequence_point)
{
undef3 (1); // { dg-error "" } implicit declaration
} // { dg-warning "no return statement" }
-
-// { dg-message "warning: control reaches end of non-void function" "" { target *-*-* } 36 }
-// { dg-message "warning: control reaches end of non-void function" "" { target *-*-* } 65 }