diff options
author | Dirk Mueller <dmueller@suse.de> | 2007-01-30 16:20:06 +0000 |
---|---|---|
committer | Dirk Mueller <mueller@gcc.gnu.org> | 2007-01-30 16:20:06 +0000 |
commit | 01a40464d42099d20da174639bc083f0780b29fe (patch) | |
tree | 4b1fcf0539bfc5a4f338f5bc53e289b007f6ca06 /gcc/doc | |
parent | 67e644395802294de723b8cafcf01cf153e47684 (diff) | |
download | gcc-01a40464d42099d20da174639bc083f0780b29fe.zip gcc-01a40464d42099d20da174639bc083f0780b29fe.tar.gz gcc-01a40464d42099d20da174639bc083f0780b29fe.tar.bz2 |
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
Diffstat (limited to 'gcc/doc')
-rw-r--r-- | gcc/doc/invoke.texi | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index eb55c9b..bd4bca6 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -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 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 -such as @code{const}. Such a type qualifier has no effect, since the -value returned by a function is not an lvalue. ISO C prohibits -qualified @code{void} return types on function definitions, so such -return types always receive a warning even without this option. +Also warn if the return type of a function has a type qualifier +such as @code{const}. For ISO C such a type qualifier has no effect, +since the value returned by a function is not an lvalue. +For C++, the warning is only emitted for scalar types or @code{void}. +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 message, even when @option{-Wno-return-type} is specified. The only |