Commit 01a40464 by Dirk Mueller Committed by Dirk Mueller

re PR c++/30601 (-Wreturn-type warns about more than what the documentation says)

2007-01-30  Dirk Mueller  <dmueller@suse.de>

       PR c++/30601
       * doc/invoke.texi (-Wreturn-type): Update description to
       match new behavior.

From-SVN: r121342
parent 67e64439
2007-01-30 Dirk Mueller <dmueller@suse.de>
PR c++/30601
* doc/invoke.texi (-Wreturn-type): Update description to
match new behavior.
2007-01-30 Richard Sandiford <richard@codesourcery.com> 2007-01-30 Richard Sandiford <richard@codesourcery.com>
* cfgrtl.c (try_redirect_by_replacing_jump): Check only_sets_cc0_p. * cfgrtl.c (try_redirect_by_replacing_jump): Check only_sets_cc0_p.
......
...@@ -2657,11 +2657,13 @@ Warn whenever a function is defined with a return-type that defaults to ...@@ -2657,11 +2657,13 @@ Warn whenever a function is defined with a return-type that defaults to
@code{int}. Also warn about any @code{return} statement with no @code{int}. Also warn about any @code{return} statement with no
return-value in a function whose return-type is not @code{void}. return-value in a function whose return-type is not @code{void}.
For C, also warn if the return type of a function has a type qualifier Also warn if the return type of a function has a type qualifier
such as @code{const}. Such a type qualifier has no effect, since the such as @code{const}. For ISO C such a type qualifier has no effect,
value returned by a function is not an lvalue. ISO C prohibits since the value returned by a function is not an lvalue.
qualified @code{void} return types on function definitions, so such For C++, the warning is only emitted for scalar types or @code{void}.
return types always receive a warning even without this option. ISO C prohibits qualified @code{void} return types on function
definitions, so such return types always receive a warning
even without this option.
For C++, a function without return type always produces a diagnostic For C++, a function without return type always produces a diagnostic
message, even when @option{-Wno-return-type} is specified. The only message, even when @option{-Wno-return-type} is specified. The only
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment