https://gcc.gnu.org/g:34527d8b0b8c5ee53b0ff92812f9c9e78a562bec

commit r16-8507-g34527d8b0b8c5ee53b0ff92812f9c9e78a562bec
Author: Christopher Albert <[email protected]>
Date:   Wed Mar 11 00:26:14 2026 +0100

    fortran: Add testcase [PR104827]
    
    The reproducer from the bug report now gives a proper error on current
    trunk instead of an ICE.  Add a testcase to prevent future regressions.
    
            PR fortran/104827
    
    gcc/testsuite/ChangeLog:
    
            PR fortran/104827
            * gfortran.dg/gomp/pr104827.f90: New test.
    
    Signed-off-by: Christopher Albert <[email protected]>

Diff:
---
 gcc/testsuite/gfortran.dg/gomp/pr104827.f90 | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/gcc/testsuite/gfortran.dg/gomp/pr104827.f90 
b/gcc/testsuite/gfortran.dg/gomp/pr104827.f90
new file mode 100644
index 000000000000..6ff250c09c04
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/gomp/pr104827.f90
@@ -0,0 +1,16 @@
+! { dg-do compile }
+! PR fortran/104827
+! Contributed by G. Steinmetz <[email protected]>
+!
+! ICE in gfc_conv_array_constructor_expr with declare variant.
+
+program main
+contains
+  subroutine f(x)
+    integer :: x
+  end subroutine
+  subroutine variant(x)
+    integer :: x
+    !$omp declare variant (f: match (construct={parallel}))  ! { dg-error 
"expected '\\)'" }
+  end subroutine
+end program

Reply via email to