aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPaul Thomas <pault@gcc.gnu.org>2025-12-06 12:58:30 +0000
committerPaul Thomas <pault@gcc.gnu.org>2025-12-06 12:58:30 +0000
commitc8450ff500a8956ec6b88596f5d544a50430df28 (patch)
tree75bbc7fde7a291fdca4d9dfc7b33eeeac89a4810 /gcc
parentda97de41f8837a9e1eea78ca049f50e105f909c8 (diff)
downloadgcc-c8450ff500a8956ec6b88596f5d544a50430df28.zip
gcc-c8450ff500a8956ec6b88596f5d544a50430df28.tar.gz
gcc-c8450ff500a8956ec6b88596f5d544a50430df28.tar.bz2
Fortran: [PDT] Verify problems with error recovery have gone [PR103414]
2025-12-06 Paul Thomas <pault@gcc.gnu.org> gcc/testsuite PR fortran/103414 * gfortran.dg/pdt_76.f03: New test.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/gfortran.dg/pdt_76.f0321
1 files changed, 21 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/pdt_76.f03 b/gcc/testsuite/gfortran.dg/pdt_76.f03
new file mode 100644
index 0000000..22c0a3e
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pdt_76.f03
@@ -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