commit 2b9ed36f61ed17ee014cc8cd883eba6df2c9ef88
Author: Jason Merrill <jason@redhat.com>
Date: Thu Jan 29 10:16:03 2015 -0500
PR c++/49508
* semantics.c (finish_return_stmt): Suppress -Wreturn-type on
erroneous return statement.
@@ -888,7 +888,13 @@ finish_return_stmt (tree expr)
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)
@@ -72,6 +72,3 @@ int darg (char X::*p)
{
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 }