Fortran: Fix character-kind=4 substring resolution (PR95837)
authorTobias Burnus <tobias@codesourcery.com>
Thu, 25 Jun 2020 14:57:08 +0000 (16:57 +0200)
committerTobias Burnus <tobias@codesourcery.com>
Thu, 25 Jun 2020 14:57:08 +0000 (16:57 +0200)
commitf48bffe70cba310461ec19ffcd07c573a6b86575
tree55c737310793db38ac215616287c8d1f50a1f6cc
parent628b78f9794a2eefcbc578011806bfa8e09b9ef7
Fortran: Fix character-kind=4 substring resolution (PR95837)

Testing showed that it is always set and its value matches
always ts->kind (if available) or otherwise, if it is a variable,
the sym->ts.kind.

gcc/fortran/ChangeLog:

PR fortran/95837
* resolve.c (gfc_resolve_substring_charlen): Remove
bogus ts.kind setting for the expression.

gcc/testsuite/ChangeLog:

PR fortran/95837
* gfortran.dg/char4-subscript.f90: New test.
gcc/fortran/resolve.c
gcc/testsuite/gfortran.dg/char4-subscript.f90 [new file with mode: 0644]