diff options
author | Jason Merrill <jason@redhat.com> | 2014-01-23 13:54:08 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2014-01-23 13:54:08 -0500 |
commit | 20f18c3ce14154eb477226aa48a12ebd32f9ead4 (patch) | |
tree | b80e9c1dd9cea4b9e0fd4dafbb7b382397e04a7d /gcc/cp/parser.c | |
parent | 928d850fcd999ed82cf5f2cfb4e24779f973e2d4 (diff) | |
download | gcc-20f18c3ce14154eb477226aa48a12ebd32f9ead4.zip gcc-20f18c3ce14154eb477226aa48a12ebd32f9ead4.tar.gz gcc-20f18c3ce14154eb477226aa48a12ebd32f9ead4.tar.bz2 |
re PR c++/55189 (enable -Wreturn-type by default)
PR c++/55189
* cp-tree.h (struct language_function): Add infinite_loop and
infinite_loops.
(current_function_infinite_loop): New.
* semantics.c (begin_maybe_infinite_loop, end_maybe_infinite_loop)
(break_maybe_infinite_loop): New.
(finish_while_stmt_cond, finish_while_stmt, begin_do_stmt)
(finish_do_stmt, finish_for_cond, finish_for_stmt)
(begin_range_for_stmt): Use them.
* decl.c (finish_function): Don't warn about missing return
if current_function_infinite_loop.
* pt.c (instantiate_decl): Copy current_function_infinite_loop.
* parser.c (cp_parser_jump_statement): Call break_maybe_infinite_loop.
From-SVN: r207001
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r-- | gcc/cp/parser.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index c02de3b..e12a528 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -10641,6 +10641,8 @@ cp_parser_jump_statement (cp_parser* parser) gcc_assert ((in_statement & IN_SWITCH_STMT) || in_statement == IN_ITERATION_STMT); statement = finish_break_stmt (); + if (in_statement == IN_ITERATION_STMT) + break_maybe_infinite_loop (); break; case IN_OMP_BLOCK: error_at (token->location, "invalid exit from OpenMP structured block"); |