]> git.ipfire.org Git - thirdparty/gcc.git/commit - gcc/cp/semantics.c
re PR c/23075 (Redundant / bogus warning)
authorJakub Jelinek <jakub@redhat.com>
Tue, 6 Sep 2005 20:07:13 +0000 (22:07 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 6 Sep 2005 20:07:13 +0000 (22:07 +0200)
commit0c9b182b9f454fb2d5f57b17d22e860490c3c68f
tree26cc76717919b282649ef97b4afa9424d824fe86
parent73109af7527b8c42510b1144cc2118a175960903
re PR c/23075 (Redundant / bogus warning)

PR c/23075
* c-typeck.c (c_finish_return): Set TREE_NO_WARNING on RETURN_EXPR
if "return with no value, in function returning non-void" warning
has been issued.
   * tree-cfg.c (execute_warn_function_return): Don't look at
RETURN_EXPRs with TREE_NO_WARNING set.

* typeck.c (check_return_expr): Add no_warning argument.  Set
*no_warning to true if "return-statement with no value, in function
returning" warning has been issued.
* cp-tree.h (check_return_expr): Adjust prototype.
* semantics.c (finish_return_stmt): Set TREE_NO_WARNING if
check_return_expr set *no_warning to true.

* gcc.dg/pr23075.c: New test.
* g++.dg/warn/pr23075.C: New test.

From-SVN: r103967
gcc/ChangeLog
gcc/c-typeck.c
gcc/cp/ChangeLog
gcc/cp/cp-tree.h
gcc/cp/semantics.c
gcc/cp/typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/warn/pr23075.C [new file with mode: 0644]
gcc/testsuite/gcc.dg/pr23075.c [new file with mode: 0644]
gcc/tree-cfg.c