diff options
author | tkoenig <tkoenig@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-10-30 17:48:27 +0000 |
---|---|---|
committer | tkoenig <tkoenig@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-10-30 17:48:27 +0000 |
commit | a57f28d28f972e8befb2d30cca475963afebe269 (patch) | |
tree | 9f87be3a5ce110418b89e042a1508d940257fa15 /gcc/fortran | |
parent | e32de7baeb35e1b8794c8d6596bd218d6ef39504 (diff) | |
download | gcc-a57f28d28f972e8befb2d30cca475963afebe269.tar.gz |
2016-10-30 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/67219
* arith.c (gfc_int2real): Change gfc_warning_now
to gfc_warning.
* primary.c (match_complex_constant): If there
is no comma, throw away any warning which might have
been issued by gfc_int2real.
2016-10-30 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/67219
* gfortran.dg/pr67219.f90: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@241689 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/fortran/arith.c | 10 | ||||
-rw-r--r-- | gcc/fortran/primary.c | 4 |
3 files changed, 18 insertions, 5 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 684af2f0d2e..be4f1b8f03f 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,12 @@ +2016-10-30 Thomas Koenig <tkoenig@gcc.gnu.org> + + PR fortran/67219 + * arith.c (gfc_int2real): Change gfc_warning_now + to gfc_warning. + * primary.c (match_complex_constant): If there + is no comma, throw away any warning which might have + been issued by gfc_int2real. + 2016-10-28 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/71891 diff --git a/gcc/fortran/arith.c b/gcc/fortran/arith.c index 8af75400d80..d566faa29cd 100644 --- a/gcc/fortran/arith.c +++ b/gcc/fortran/arith.c @@ -2072,11 +2072,11 @@ gfc_int2real (gfc_expr *src, int kind) if (warn_conversion && wprecision_int_real (src->value.integer, result->value.real)) - gfc_warning_now (OPT_Wconversion, "Change of value in conversion " - "from %qs to %qs at %L", - gfc_typename (&src->ts), - gfc_typename (&result->ts), - &src->where); + gfc_warning (OPT_Wconversion, "Change of value in conversion " + "from %qs to %qs at %L", + gfc_typename (&src->ts), + gfc_typename (&result->ts), + &src->where); return result; } diff --git a/gcc/fortran/primary.c b/gcc/fortran/primary.c index bcbaeaa6369..2101644fcdc 100644 --- a/gcc/fortran/primary.c +++ b/gcc/fortran/primary.c @@ -1353,6 +1353,10 @@ match_complex_constant (gfc_expr **result) if (gfc_match_char (',') == MATCH_NO) { + /* It is possible that gfc_int2real issued a warning when + converting an integer to real. Throw this away here. */ + + gfc_clear_warning (); gfc_pop_error (&old_error); m = MATCH_NO; goto cleanup; |