From: Paul Thomas Date: Sat, 6 Dec 2025 12:58:30 +0000 (+0000) Subject: Fortran: [PDT] Verify problems with error recovery have gone [PR103414] X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c8450ff500a8956ec6b88596f5d544a50430df28;p=thirdparty%2Fgcc.git Fortran: [PDT] Verify problems with error recovery have gone [PR103414] 2025-12-06 Paul Thomas gcc/testsuite PR fortran/103414 * gfortran.dg/pdt_76.f03: New test. --- diff --git a/gcc/testsuite/gfortran.dg/pdt_76.f03 b/gcc/testsuite/gfortran.dg/pdt_76.f03 new file mode 100644 index 00000000000..22c0a3efa50 --- /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 +! +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