This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[4.3] wcoercion (4): fixes for C++ front-end


( 4th patch in the series from the Wcoercion Project )

This patch addresses some issues with the implementation of
Wconversion in the C++ front-end:

* Adds testcases for the C++ front-end. The testcases are exactly
equal to those in the C front-end.

* warns for int i = 1.1 but not for int i = 1.0 (I think this is a
better fix for PR13932).

* updates  the manual to document all warnings given for C++. (I am
not an expert in C++ so suggestions are certainly welcome).

Jason Merrill agreed to review this patch but any comments are
welcome. In particular, I am not sure what side-effects may have the
use of convert_and_check() in C++ (which uses convert internally)
since sometimes the C++ front-end uses cp_convert() and other
functions instead of convert().

Bootstrapped and tested with --enable-languages=all for trunk revision
118055 on i686-pc-linux-gnu

2006-11-17 Manuel Lopez-Ibanez <>

     * cp/call.c (convert_like_real): Use convert_and_check() instead
of custom warning.
     * cp/typeck.c (build_binary_op): Use convert_and_check() before
     * doc/invoke.texi (-Wconversion): Document warnings specific to C++.

2006-11-17  Manuel Lopez-Ibanez <>

     * 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: Modified.

Attachment: wcoercion-4
Description: Binary data

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]