]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fortran: error recovery on invalid code with SELECT TYPE
authorHarald Anlauf <anlauf@gmx.de>
Tue, 26 Oct 2021 20:22:36 +0000 (22:22 +0200)
committerHarald Anlauf <anlauf@gmx.de>
Tue, 26 Oct 2021 20:22:36 +0000 (22:22 +0200)
gcc/testsuite/ChangeLog:

PR fortran/86551
* gfortran.dg/pr86551.f90: New test to verify that PR86551 remains
fixed.

gcc/testsuite/gfortran.dg/pr86551.f90 [new file with mode: 0644]

diff --git a/gcc/testsuite/gfortran.dg/pr86551.f90 b/gcc/testsuite/gfortran.dg/pr86551.f90
new file mode 100644 (file)
index 0000000..d96e17a
--- /dev/null
@@ -0,0 +1,12 @@
+! { dg-do compile }
+! PR fortran/86551 - ICE on invalid code with select type / end select type
+
+subroutine b
+  type :: t1
+  end type t1
+  class(t1) :: c2
+  select type (d => c2)
+  end select type       ! { dg-error "Syntax error" }
+end                     ! { dg-error "END SELECT statement expected" }
+
+! { dg-prune-output "Unexpected end of file" }