https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104131
--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Kwok Yeung <k...@gcc.gnu.org>: https://gcc.gnu.org/g:88c4d85e27e18bf991ab8728b73127a0385f2c27 commit r12-7464-g88c4d85e27e18bf991ab8728b73127a0385f2c27 Author: Kwok Cheung Yeung <k...@codesourcery.com> Date: Thu Mar 3 10:23:26 2022 +0000 openmp, fortran: Check that the type of an event handle in a detach clause is suitable [PR104131] This rejects variables that are array types, array elements or derived type members when used as the event handle inside a detach clause (in accordance with the OpenMP specification). This would previously lead to an ICE. 2022-03-03 Kwok Cheung Yeung <k...@codesourcery.com> gcc/fortran/ PR fortran/104131 * openmp.cc (gfc_match_omp_detach): Move check for type of event handle to... (resolve_omp_clauses) ...here. Also check that the event handle is not an array, or an array access or structure element access. gcc/testsuite/ PR fortran/104131 * gfortran.dg/gomp/pr104131.f90: New. * gfortran.dg/gomp/task-detach-1.f90: Update expected error message.