re PR fortran/47659 (-Wconversion[-extra] should emit warning for constant expressions)
authorThomas Koenig <tkoenig@gcc.gnu.org>
Sun, 21 Aug 2011 16:35:28 +0000 (16:35 +0000)
committerThomas Koenig <tkoenig@gcc.gnu.org>
Sun, 21 Aug 2011 16:35:28 +0000 (16:35 +0000)
commit6cd1d48e9e4dd7ceb80a6dff6f113d5020c5d9d6
tree1f4e191a57eb5e520ee4afb6a3a660851d2d1f2a
parent38acd2910a3a23bc48131ceef153ac52f23b8ed6
re PR fortran/47659 (-Wconversion[-extra] should emit warning for constant expressions)

2011-08-21  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/47659
* expr.c (gfc_check_assign): Check for type conversions when the
right-hand side is a constant REAL/COMPLEX contstant the left-hand
side is also REAL/COMPLEX.  Don't warn when a narrowing conversion
for REAL does not change the value of the constant.

2011-08-21  Thomas Koenig  <tkoenig@gcc.gnu.org>

PR fortran/47659
* gfortran.dg/warn_conversion_2.f90:  Also warn about conversion
of a constant resulting from simplification.
* gfortran.dg/warn_conversion_3.f90:  New test.

From-SVN: r177942
gcc/fortran/ChangeLog
gcc/fortran/expr.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/warn_conversion_2.f90
gcc/testsuite/gfortran.dg/warn_conversion_3.f90 [new file with mode: 0644]