diff options
author | Manuel López-Ibáñez <manu@gcc.gnu.org> | 2007-03-16 23:32:12 +0000 |
---|---|---|
committer | Manuel López-Ibáñez <manu@gcc.gnu.org> | 2007-03-16 23:32:12 +0000 |
commit | 07231d4f834e1286c28f28bd18065fdde30912ba (patch) | |
tree | 5a95c9649676f7d06f094cc2fa3481529f14eef5 /gcc/doc | |
parent | aefd26064caa4f8e041540679169265d74e8f3fd (diff) | |
download | gcc-07231d4f834e1286c28f28bd18065fdde30912ba.zip gcc-07231d4f834e1286c28f28bd18065fdde30912ba.tar.gz gcc-07231d4f834e1286c28f28bd18065fdde30912ba.tar.bz2 |
invoke.texi (-Wconversion): Document warnings specific to C++.
2007-03-16 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
* doc/invoke.texi (-Wconversion): Document warnings specific to C++.
* c-common.c (convert_and_check): Move warning logic to...
(warnings_for_convert_and_check): ...here. Define.
* c-common.h (warnings_for_convert_and_check): Declare.
cp/
* cvt.c (cp_convert_and_check) : Define.
* cp-tree.h (cp_convert_and_check): Declare.
* call.c (convert_conversion_warnings): Rename to
conversion_null_warnings. The warning for floating-point to
integer is handled by convert_and_check in convert_like_real.
(convert_like_real): convert_conversion_warnings was renamed as
conversion_null_warnings.
* typeck.c (build_binary_op): Use cp_convert_and_check to warn for
overflow and changes of value during conversion.
testsuite/
* g++.dg/warn/Wconversion-integer.C: New
* g++.dg/warn/Wconversion-real.C: New.
* g++.dg/warn/Wconversion-real-integer.C: New.
* g++.dg/warn/conv2.C: Updated.
From-SVN: r123005
Diffstat (limited to 'gcc/doc')
-rw-r--r-- | gcc/doc/invoke.texi | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index fa9ed7f..b3fe752 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -3396,6 +3396,12 @@ like @code{unsigned ui = -1}; and conversions to smaller types, like ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not changed by the conversion like in @code{abs (2.0)}. +For C++, also warn for conversions between @code{NULL} and non-pointer +types; confusing overload resolution for user-defined conversions; and +conversions that will never use a type conversion operator: +conversions to @code{void}, the same type, a base class or a reference +to them. + @item -Wempty-body @opindex Wempty-body An empty body occurs in an @samp{if}, @samp{else} or @samp{do while} |