]> gcc.gnu.org Git - gcc.git/commit
Fortran : "type is( real(kind(1.)) )" spurious syntax error PR94397
authorMark Eggleston <markeggleston@gcc.gnu.org>
Wed, 1 Apr 2020 08:52:41 +0000 (09:52 +0100)
committerMark Eggleston <markeggleston@gcc.gnu.org>
Thu, 28 May 2020 14:12:33 +0000 (15:12 +0100)
commite211b3da3899b3496add56ba45acb07569e7c15a
treef9004541d67d38f2bffbab8332eb272da836dd6a
parentc575cd2e0089cf2fcb11ffb7899e5fd472b3780c
Fortran  : "type is( real(kind(1.)) )" spurious syntax error PR94397

Based on a patch in the comments of the PR. That patch fixed this
problem but caused the test cases for PR93484 to fail. It has been
changed to reduce initialisation expressions if the expression is
not EXPR_VARIABLE and not EXPR_CONSTANT.

2020-05-28  Steven G. Kargl  <kargl@gcc.gnu.org>
    Mark Eggleston  <markeggleston@gcc.gnu.org>

gcc/fortran/

PR fortran/94397
* match.c (gfc_match_type_spec): New variable ok initialised
to true. Set ok with the return value of gfc_reduce_init_expr
called only if the expression is not EXPR_CONSTANT and is not
EXPR_VARIABLE. Add !ok to the check for type not being integer
or the rank being greater than zero.

2020-05-28  Mark Eggleston  <markeggleston@gcc.gnu.org>

gcc/testsuite/

PR fortran/94397
* gfortran.dg/pr94397.F90: New test.

(cherry picked from commit 3ea6977d0f1813d982743a09660eec1760e981ec)
gcc/fortran/match.c
gcc/testsuite/gfortran.dg/pr94397.F90 [new file with mode: 0644]
This page took 0.067069 seconds and 6 git commands to generate.