diff options
author | Steven G. Kargl <kargl@gcc.gnu.org> | 2019-08-10 18:26:13 +0000 |
---|---|---|
committer | Steven G. Kargl <kargl@gcc.gnu.org> | 2019-08-10 18:26:13 +0000 |
commit | 878f88b7d14a33b031aaf0ae797bb39d21f74676 (patch) | |
tree | a46d0e4c5948327c1c6686fd1403fc7756bd9259 /gcc/fortran/decl.c | |
parent | 884efbd523b7191edd7763ae8bba8afc96e3c238 (diff) | |
download | gcc-878f88b7d14a33b031aaf0ae797bb39d21f74676.zip gcc-878f88b7d14a33b031aaf0ae797bb39d21f74676.tar.gz gcc-878f88b7d14a33b031aaf0ae797bb39d21f74676.tar.bz2 |
decl.c (match_old_style_init): Use a clearer error message.
2019-08-10 Steven G. Kargl <kargl@gcc.gnu.org>
* decl.c (match_old_style_init): Use a clearer error message.
* expr.c (gfc_check_assign): Update BOZ checking to provide a stricter
adherence to the Fortran standard. Use gfc_invalid_boz () to
relax errors into warnings.
* gfortran.h (gfc_isym_id): Add new ids GFC_ISYM_DFLOAT,
GFC_ISYM_FLOAT, GFC_ISYM_REALPART, and GFC_ISYM_SNGL
* intrinsic.c (add_functions): Use new ids to split REAL generic into
REAL, FLOAT, DFLOAT, SNGL, and REALPART generics.
(gfc_intrinsic_func_interface): Allow new intrinsics in an
initialization expression
* resolve.c (resolve_operator): Deal with BOZ as operands.
Use gfc_invalid_boz to allow for errors or warnings via the
-fallow-invalid-boz option. A BOZ cannot be an operand to an
unary operator. Both operands of a binary operator cannot be BOZ.
For binary operators, convert a BOZ operand into the type and
kind of the other operand for REAL or INTEGER operand.
* trans-intrinsic.c: Use new ids to cause conversions to happen.
2019-08-10 Steven G. Kargl <kargl@gcc.gnu.org>
* gfortran.dg/boz_8.f90: Adjust error messages.
* gfortran.dg/nan_4.f90: Ditto.
* gfortran.dg/boz_1.f90: Add -fallow-invalid-boz to dg-options,
and test for warnings.
* gfortran.dg/boz_3.f90: Ditto.
* gfortran.dg/boz_4.f90: Ditto.
* gfortran.dg/dec_structure_6.f90: Ditto.
* gfortran.dg/ibits.f90: Ditto.
From-SVN: r274257
Diffstat (limited to 'gcc/fortran/decl.c')
-rw-r--r-- | gcc/fortran/decl.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index 7a442ca..436dd10 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -579,9 +579,10 @@ match_old_style_init (const char *name) && nd->var->expr->ts.type != BT_REAL && nd->value->expr->ts.type == BT_BOZ) { - gfc_error ("Mismatch in variable type and BOZ literal constant " - "at %L in an old-style initialization", - &nd->value->expr->where); + gfc_error ("BOZ literal constant near %L cannot be assigned to " + "a %qs variable in an old-style initialization", + &nd->value->expr->where, + gfc_typename (&nd->value->expr->ts)); return MATCH_ERROR; } } |