2019-06-19 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/69499
* match.c (gfc_match_select_type): SELECT TYPE is an executable
statement, and cannot appear in MODULE or SUBMODULE scope.
2019-06-19 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/69499
* gfortran.dg/pr69499.f90: New test.
* gfortran.dg/module_error_1.f90: Update dg-error string.
From-SVN: r272482
+2019-06-19 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/69499
+ * match.c (gfc_match_select_type): SELECT TYPE is an executable
+ statement, and cannot appear in MODULE or SUBMODULE scope.
+
2019-06-19 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/69398
if (m != MATCH_YES)
return m;
+ if (gfc_current_state() == COMP_MODULE
+ || gfc_current_state() == COMP_SUBMODULE)
+ {
+ gfc_error ("SELECT TYPE at %C cannot appear in this scope");
+ return MATCH_ERROR;
+ }
+
gfc_current_ns = gfc_build_block_ns (ns);
m = gfc_match (" %n => %e", name, &expr2);
if (m == MATCH_YES)
+2019-06-19 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/69499
+ * gfortran.dg/pr69499.f90: New test.
+ * gfortran.dg/module_error_1.f90: Update dg-error string.
+
2019-06-19 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/69398
! { dg-do compile }
! PR fortran/50627
module kernels
- select type (args) ! { dg-error "Unexpected SELECT TYPE" }
+ select type (args) ! { dg-error "cannot appear in this scope" }
end module kernels
--- /dev/null
+! { dg-do compile }
+! PR fortran/69499
+! Contributed by Gerhard Steinmetz.
+module m
+ class(*) :: z ! { dg-error "must be dummy, allocatable or pointer" }
+ select type (x => z) ! { dg-error "cannot appear in this scope" }
+end