diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-01-29 16:10:08 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-01-29 16:10:08 +0000 |
commit | dbe1241ef3cae41f34c6b230749f0149db01c3cb (patch) | |
tree | ebaa6ad5759d2bfc191620ddfe9f9424485194f7 /gcc/cp | |
parent | cdc99fba5cb0607e850b270658a4eca1a0e51a52 (diff) | |
download | gcc-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')
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/semantics.c | 8 |
2 files changed, 11 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index fb3e2dc79e4..2280e6bd094 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,9 @@ 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. 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) |