Please find attached a patch, it is based on Steve Kargl's patch in PR93580 adding  a check for %len and test case. The commit message in the patch includes change logs as I believe that is the intended way forward. One thing I'm unsure of it how handle multiple authors, it was easy in the ChangeLog files but it is not obvious for git commit messages. OK for master and gcc 9 branch? gcc/fortran/ChangeLog:     Steven G. Kargl      Mark Eggleston      PR fortran/93580     * primary.c (gfc_match_varspec): If the symbol following %     is re or im and the primary expression type is not BT_COMPLEX     issue an error. If the symbol is len and the primary     expression type is not BT_CHARACTER is an error. gcc/testsuite/ChangeLog:     Mark Eggleston     PR fortran/93580     * gfortran.dg/dg/pr93580.f90: New test. -- https://www.codethink.co.uk/privacy.html