re PR fortran/78221 (bogus warning: Non-zero imaginary part discarded in conversion [-Wconversion])
2016-11-06 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/78221 * arith.c (gfc_complex2real): Change gfc_warning_now to gfc_warning. 2016-11-06 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/78221 * gfortran.dg/warn_conversion_9.f90: New test. From-SVN: r241884
This commit is contained in:
parent
0ddd4af5f4
commit
18bb8b8a2a
@ -1,3 +1,9 @@
|
||||
2016-11-06 Thomas Koenig <tkoenig@gcc.gnu.org>
|
||||
|
||||
PR fortran/78221
|
||||
* arith.c (gfc_complex2real): Change gfc_warning_now to
|
||||
gfc_warning.
|
||||
|
||||
2016-11-05 Paul Thomas <pault@gcc.gnu.org>
|
||||
|
||||
* check.c (gfc_check_move_alloc): Introduce error to prevent
|
||||
|
@ -2369,10 +2369,10 @@ gfc_complex2real (gfc_expr *src, int kind)
|
||||
/* See if we discarded an imaginary part. */
|
||||
if (mpfr_cmp_si (mpc_imagref (src->value.complex), 0) != 0)
|
||||
{
|
||||
gfc_warning_now (w, "Non-zero imaginary part discarded "
|
||||
"in conversion from %qs to %qs at %L",
|
||||
gfc_typename(&src->ts), gfc_typename (&result->ts),
|
||||
&src->where);
|
||||
gfc_warning (w, "Non-zero imaginary part discarded "
|
||||
"in conversion from %qs to %qs at %L",
|
||||
gfc_typename(&src->ts), gfc_typename (&result->ts),
|
||||
&src->where);
|
||||
did_warn = true;
|
||||
}
|
||||
|
||||
|
@ -1,3 +1,9 @@
|
||||
2016-11-06 Thomas Koenig <tkoenig@gcc.gnu.org>
|
||||
|
||||
PR fortran/78221
|
||||
* arith.c (gfc_complex2real): Change gfc_warning_now to
|
||||
gfc_warning.
|
||||
|
||||
2016-11-05 Paul Thomas <pault@gcc.gnu.org>
|
||||
|
||||
* gfortran.dg/move_alloc_17.f03: New test.
|
||||
|
7
gcc/testsuite/gfortran.dg/warn_conversion_9.f90
Normal file
7
gcc/testsuite/gfortran.dg/warn_conversion_9.f90
Normal file
@ -0,0 +1,7 @@
|
||||
! { dg-do compile }
|
||||
! { dg-options "-Wconversion" }
|
||||
! PR 78221 - used to give a spurious warning
|
||||
complex, parameter :: i = (0.,1.)
|
||||
complex :: t
|
||||
t = (i)
|
||||
end
|
Loading…
Reference in New Issue
Block a user