]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fortran: [PDT] Verify problems with error recovery have gone [PR103414]
authorPaul Thomas <pault@gcc.gnu.org>
Sat, 6 Dec 2025 12:58:30 +0000 (12:58 +0000)
committerPaul Thomas <pault@gcc.gnu.org>
Sat, 6 Dec 2025 12:58:30 +0000 (12:58 +0000)
2025-12-06  Paul Thomas  <pault@gcc.gnu.org>

gcc/testsuite
PR fortran/103414
* gfortran.dg/pdt_76.f03: New test.

gcc/testsuite/gfortran.dg/pdt_76.f03 [new file with mode: 0644]

diff --git a/gcc/testsuite/gfortran.dg/pdt_76.f03 b/gcc/testsuite/gfortran.dg/pdt_76.f03
new file mode 100644 (file)
index 0000000..22c0a3e
--- /dev/null
@@ -0,0 +1,21 @@
+! { dg-do compile }
+
+! Make sure that pr103414 is fixed.
+!
+! Contributed by Gerhard Steinmetz  <gscfq@t-online.de>
+!
+function p ()
+   type t(n)
+      integer, kind :: n
+      character(n) :: c = ''
+   end type
+   type(t(3)) :: x = t(z'1') ! { dg-error "Expected an initialization expression" }
+end
+
+function q ()
+   type t(n)
+      integer, kind :: n
+      character(n) :: c = ''
+   end type
+   type(t(3)) :: x(1) = [t(z'1')] ! { dg-error "Syntax error in array constructor" }
+end