diff options
Diffstat (limited to 'gcc/cp/semantics.c')
-rw-r--r-- | gcc/cp/semantics.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 75aa501fe8c..f325e41f417 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -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) |