fortran: Object types should be declared before use in NAMELIST.
authorJerry DeLisle <jvdelisle@gcc.gnu.org>
Fri, 19 Feb 2021 20:47:54 +0000 (12:47 -0800)
committerJerry DeLisle <jvdelisle@gcc.gnu.org>
Fri, 19 Feb 2021 20:47:54 +0000 (12:47 -0800)
commitdfa2f821c18b7e926b5f5d6e394a0c915937db5e
treedb8df1cf647142fab67bad6b2152187c9e158d1b
parentd1e7e83aaf11274266d83b7be5ce013b95e8b8c2
fortran: Object types should be declared before use in NAMELIST.

gcc/fortran/ChangeLog:

PR fortran/98686
* match.c (gfc_match_namelist): If BT_UNKNOWN, check for
IMPLICIT NONE and and issue an error, otherwise set the type
to its IMPLICIT type so that any subsequent use of objects will
will confirm their types.

gcc/testsuite/ChangeLog:

PR fortran/98686
* gfortran.dg/namelist_4.f90: Modify.
* gfortran.dg/namelist_98.f90: New test.
gcc/fortran/match.c
gcc/testsuite/gfortran.dg/namelist_4.f90
gcc/testsuite/gfortran.dg/namelist_98.f90 [new file with mode: 0644]