This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/47659] -Wconversion[-extra] should emit warning for constant expressions
- From: "tkoenig at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 21 Aug 2011 16:35:31 +0000
- Subject: [Bug fortran/47659] -Wconversion[-extra] should emit warning for constant expressions
- Auto-submitted: auto-generated
- References: <bug-47659-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47659
--- Comment #6 from Thomas Koenig <tkoenig at gcc dot gnu.org> 2011-08-21 16:35:31 UTC ---
Author: tkoenig
Date: Sun Aug 21 16:35:28 2011
New Revision: 177942
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=177942
Log:
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.
Added:
trunk/gcc/testsuite/gfortran.dg/warn_conversion_3.f90
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/expr.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gfortran.dg/warn_conversion_2.f90