summaryrefslogtreecommitdiff
path: root/gcc/cp/semantics.c
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2015-01-29 16:10:08 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2015-01-29 16:10:08 +0000
commitdbe1241ef3cae41f34c6b230749f0149db01c3cb (patch)
treeebaa6ad5759d2bfc191620ddfe9f9424485194f7 /gcc/cp/semantics.c
parentcdc99fba5cb0607e850b270658a4eca1a0e51a52 (diff)
downloadgcc-dbe1241ef3cae41f34c6b230749f0149db01c3cb.tar.gz
PR c++/49508
* 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
Diffstat (limited to 'gcc/cp/semantics.c')
-rw-r--r--gcc/cp/semantics.c8
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)