[PATCH] PR94397 the compiler consider "type is( real(kind(1.)) )" as a syntax error

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] PR94397 the compiler consider "type is( real(kind(1.)) )" as a syntax error

Mark Eggleston
Please find attached a patch for PR94397.

Commit message:

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. Changed to reduce
initialisation expressions if the expression is not EXPR_VARIABLE and not
EXPR_CONSTANT.

2020-05-13  Steven G. Kargl  <[hidden email]>
             Mark Eggleston <[hidden email]>

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-13  Mark Eggleston <[hidden email]>

gcc/testsuite/

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

The formatting with tabs and date will be corrected prior to commit.

Tested on x86_64 for master, releases/gcc-9, releases/gcc-10 branches.
OK to commit and backport?

--
https://www.codethink.co.uk/privacy.html


0001-pr94397.patch (2K) Download Attachment